Thread: protection
View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default protection

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.

"Darrell_Sarrasin via OfficeKB.com" wrote:

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
called manager

Gord Dibben wrote:
Dave's code is meant to auto run when the workbook opens, not manually run
after the workbook is already open.

Did you copy/paste into a general module?

Gord Dibben MS Excel MVP

Hi Dave thanks for the macro. If I run it when the document is open it works
great protects everything I want protected and allows me to use the group

[quoted text clipped - 31 lines]
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200809/1


--
Message posted via OfficeKB.com
http://www.officekb.com/Uwe/Forums.a...tions/200809/1


--

Dave Peterson