ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   protect/unprotect grouped worksheets (https://www.excelbanter.com/excel-programming/323320-protect-unprotect-grouped-worksheets.html)

Todd

protect/unprotect grouped worksheets
 
Hi, I have these macro's below that protect/unprotect all worksheets in the
book. How do I get them to only work on the sheets I selected?

TIA

Todd


Sub ProtectAll()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Protect Password:=""
Next ws
End Sub

Sub UnprotectAll()
Dim ws As Worksheet
For Each ws In Worksheets
ws.Unprotect Password:=""
Next ws
End Sub


All times are GMT +1. The time now is 04:38 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com