Hello again
I have seen the macro that password-protects ALL sheets in an excel file, i.e.:
Sub ProtectAllSheets()
'Protect sheets - using password
Dim ws As Worksheet
Dim sOrigSheet As String
Dim sOrigCell As String
Dim J As Integer
Application.ScreenUpdating = False
sOrigSheet = ActiveSheet.Name
sOrigCell = ActiveCell.Address
For Each ws In Worksheets
ws.Select
ws.Protect Password:="test"
Next ws
Application.GoTo Reference:=Worksheets("" & sOrigSheet & "").Range("" & sOrigCell & "")
Application.ScreenUpdating = True
End Sub
How do you adapt it to password-protect only say the 3,4,5 & 9 sheets in an 11-sheet file?
Thanks again - and apologies if these seem dumb questions I will also do a search in case it has been answered previously.
Dugong
I have seen the macro that password-protects ALL sheets in an excel file, i.e.:
Sub ProtectAllSheets()
'Protect sheets - using password
Dim ws As Worksheet
Dim sOrigSheet As String
Dim sOrigCell As String
Dim J As Integer
Application.ScreenUpdating = False
sOrigSheet = ActiveSheet.Name
sOrigCell = ActiveCell.Address
For Each ws In Worksheets
ws.Select
ws.Protect Password:="test"
Next ws
Application.GoTo Reference:=Worksheets("" & sOrigSheet & "").Range("" & sOrigCell & "")
Application.ScreenUpdating = True
End Sub
How do you adapt it to password-protect only say the 3,4,5 & 9 sheets in an 11-sheet file?
Thanks again - and apologies if these seem dumb questions I will also do a search in case it has been answered previously.
Dugong