Hi everyone
I really need help on this please....
I use this vba code on a worksheets in my workbook to lock information after
saving to prevent any modification from employees after they use the worksheet.
It's working great but i need to know how to include more sheets now:"sheet1" + 3 other worksheets ... and maybe more in the futur.
I don't know how to include those sheets in the following vba code.
Thanks for your help.
I'm new on this forum so i hope i did everything correctly and sorry for my english i'm french.
Steve.
Private Sub Workbook_Open()
Dim wsh As Worksheet
Dim rng As Range
Set wsh = Me.Worksheets("Sheet1")
On Error Resume Next
wsh.Unprotect Password:="Secret"
wsh.Cells.Locked = False
Set rng = wsh.UsedRange.SpecialCells(xlCellTypeConstants)
If Not rng Is Nothing Then
rng.Locked = True
End If
Set rng = wsh.UsedRange.SpecialCells(xlCellTypeFormulas)
If Not rng Is Nothing Then
rng.Locked = True
End If
wsh.Protect Password:="Secret"
End Sub
Bookmarks