vba worksheet and range

T

tinybears

Hey,

Two small question:

1. How can I make sure a user can't delete a worksheet. Since I
constantly make new sheets and delete hem myself this should be in VBA
and must not interrupt with my own deleten en making worksheets. So it
should only be in Excel hisself.

2. I have a range of cells in excel that the user can see, but I want
him to prevent scrolling down. Can I do that in VBA and how

thx in advance

Dieter
 
P

PeterAtherton

Dieter

something like this

Sub test()
Dim i As Long
'leave first and last cell visible
For i = 65535 To 2 Step -1
If IsEmpty(Cells(i, 1)) Then
Cells(i, 1).EntireRow.Hidden = True
End If
Next
End Sub

It takes a few minutes to run

Regards
Peter
 
P

PeterAtherton

I forgot q1. You can password protect the workbook structure using a
password. Remember that Excel is not that safe though.

Peter
 
T

tinybears

Thx; but since it slows down my workbook I won't us it. I already found
the first problem.

Thx
 
Top