PDA

View Full Version : [SOLVED] Sheet Protection



austenr
11-21-2004, 02:31 PM
How can I modify this if I have 4 sheets and only want tp protect sheets 1, 2 and 4?


Public Sub ProtectAllSheets()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ws.Protect
Next ws
Sheet1.Activate
Application.ScreenUpdating = True
End Sub

Ken Puls
11-21-2004, 02:58 PM
Hi Austen,

One way is to change this


ws.Protect

to


If Not ws.Name = "Sheet3" Then ws.Protect

HTH,

austenr
11-21-2004, 03:12 PM
thanks

Ken Puls
11-21-2004, 03:13 PM
You're welcome!