Notifications
Clear all
General Excel Questions & Answers
4
Posts
2
Users
0
Reactions
67
Views
Topic starter
Hi There,
I have a workbook that contains 11 worksheets, I have hidden columns on all 11 and want to protect each sheet so users can not un-hide the columns.
I know how to protect an individual worksheet, is there a way to protect all 11 worksheets in one go?
Thanks
Paul
Posted : 03/10/2017 1:07 pm
Hello
Try this code
Sub Test()
Dim ws As Worksheet
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect "123" 'Change 123 to your password
Next ws
End Sub
Posted : 03/10/2017 1:19 pm
Topic starter
Thanks
Posted : 04/10/2017 5:45 am
You're welcome. Glad I can offer some help
Posted : 04/10/2017 8:45 am