Since there are only two sheets, you could do:
Option Explicit
Sub auto_open()
With Worksheets("attendance")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
With Worksheets("manager")
.Protect Password:="hi", userinterfaceonly:=True
.EnableOutlining = True
End With
End Sub
And it's probably the easiest way if you have different passwords for each
sheet.
If you have lots of sheets that use the same password, then there are other
options.
thank you I was doing it in the wrong place. can I use the same code and do
more then one sheet i have two sheets one called attendance record the other
[quoted text clipped - 16 lines]