vba worksheet and range

  • Thread starter Thread starter tinybears
  • Start date Start date
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
 
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
 
I forgot q1. You can password protect the workbook structure using a
password. Remember that Excel is not that safe though.

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

Thx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top