Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

lock/unlock sheets

Status
Not open for further replies.

Jaffey

Technical User
Jul 18, 2006
72
CA
I have a spreadsheet with about 20 tabs. I need a macro to unlock/lock all of them. Problem is, sometimes some of them are already locked/unloced so my macro bombs.

Sub Macro1()
'
ActiveSheet.Next.Select
ActiveSheet.Unprotect
ActiveSheet.Next.Select
ActiveSheet.Unprotect

End Sub

Can anyone help with a macro that will unlock or lock all sheets? If it could enter the password as well that would be great.
 




Hi,

Since this is a VBA question, please repost in VBA Visual Basic for Applications (Microsoft) Forum707.

Skip,

[glasses] [red][/red]
[tongue]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top