Workbook protection
Sub ProtectAllSheets()
'the name of the Sub
Application.ScreenUpdating = False
'turn off the screen flashing
Dim n As Single
'Set the data type as (single-precision floating-point)
For n = 1 To Sheets.Count
'count the sheets in the workbook
Sheets(n).Protect Password:="justme"
'protect the first sheet counted
Next n
'protect the next sheet counted and keep cycling until all sheets are protected
Application.ScreenUpdating = True
'turn screen updating back on
End Sub
Gord
On Wed, 26 Apr 2006 11:10:53 -0500, Bonbon
wrote:
That worked great, but could you go through each code/instruction and
explain what it means please? because i need to explain it to the user,
thanks.
Bonbon
Gord Dibben MS Excel MVP
|