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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Bothersome Excel Worksheet Protection/Unprotection

Status
Not open for further replies.

jabrony76

Technical User
Apr 23, 2001
125
US
Hi all,
I have noticed that you cannot protect or unprotect a highlighted group of multipule worksheets at once. (at least I cant figure it out) Is this possible? Its very annoying to have to select each worksheet individually and unprotect or protect it. I have some workbooks that have 30 different sheets to them. Any tips would be greatly appreciated.

Thanks,
Andy
 
Type this in the VBA (Alt+F11) area

Private Sub ProtectAll()

Dim i
For i = 1 To ActiveWorkbook.Worksheets.Count
ActiveWorkbook.Worksheets(i).Protect
Next i


End Sub
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top