Locking down a tab

G

GGanders

I know you can pass protect a spreadsheet but does anyone know a way I
can pass protect a tab instead of the entire spreadsheet?
 
N

Nick Hodge

Are you trying to stop the tab being renamed?

If so, you could check it with the worksheet_deactivate event like so

Private Sub Worksheet_Deactivate()
If Me.Name <> "Test" Then
MsgBox "You cannot rename this sheet to " & Me.Name & " renaming to
Test...", vbOKOnly
Me.Name = "Test"
End If
End Sub

If you try to exit the sheet with the name not set to Test, it will stop you
and rename it.

Deactivate may not be the correct event or the only one, but it may give you
a start

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
www.nickhodge.co.uk
[email protected]
 
G

Gord Dibben

There are several types of protection.

1. Password to open the file. Can be set at File>Save As>Tools>General
Options.

2. Password on a protected worksheet. This is set at Tools>Protection>Protect
Sheet.

Many functions can be disabled using this type of protection.

3. Workbook Protection password. This is set at Tools>Protection>Protect
Workbook.

This protects the workbook from having sheets deleted and other functions
disabled.

4. VBA Project password to prevent viewers from looking at code modules.

NOTE: except for File to Open protection and VBA project passwords, most forms
of Excel protection are very weak and passwords can be easily cracked.


Gord Dibben MS Excel MVP

I know you can pass protect a spreadsheet but does anyone know a way I
can pass protect a tab instead of the entire spreadsheet?

Gord Dibben MS Excel MVP
 
Top