Hi Dino!
Try copying and pasting the following to your Personal.xls file or to
a module in the workbook that you want to use them in:
Sub ProtectAllSheets()
Dim n As Integer
For n = 1 To Worksheets.Count
Worksheets(n).Protect Password:="not4u2see"
Next n
End Sub
Sub UnprotectAllSheets()
Dim n As Integer
For n = 1 To Worksheets.Count
Worksheets(n).Unprotect Password:="not4u2see"
Next n
End Sub
Or, better still, you might use:
Public Sub ToggleProtect1()
' From J E McGimpsey
Const PWORD As String = "not4u2see"
Dim wkSht As Worksheet
Dim statStr As String
For Each wkSht In ActiveWorkbook.Worksheets
With wkSht
statStr = statStr & vbNewLine & "Sheet " & .Name
If .ProtectContents Then
wkSht.Unprotect Password:=PWORD
statStr = statStr & ": Unprotected"
Else
wkSht.Protect Password:=PWORD
statStr = statStr & ": Protected"
End If
End With
Next wkSht
MsgBox Mid(statStr, 2)
End Sub
Assign this macro to a particular key or toolbar button and it allows
you to toggle between protected and unprotected status.
Any further help on how to achieve the above, then post back and
someone, if not me, will walk you through it.
--
Regards
Norman Harker MVP (Excel)
Sydney, Australia
Holidays and Observances Wednesday 6th August 2003: Bolivia
(Independence Day), Bulgaria (The Transfiguration), Jamaica
(Independence Day), United Arab Emirates (Accession of H.H. Sheikh
Zayed). Observances: Hiroshima Day (08:15 Local Time 6th August 1945),
Hiroshima Peace Ceremony (Shinto), The Transfiguration (Christianity).
(e-mail address removed)
Excel and Word Function Lists (Classifications, Syntax and Arguments)
available free to good homes.