christianbiker
Active Member
- Joined
- Feb 3, 2006
- Messages
- 365
Hi,
I am currently using the following code to protect/unprotect each sheet in a workbook:
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Unprotect "PASSWORD"
End With
Next ws
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Protect "PASSWORD"
End With
Next ws
I figured that I could also use it for charts that I have set up as separate tabs however it does not seem to be working. Is there any way to set up code to protect every tab in an open workbook?
Any help would be appreciated...thanks!
I am currently using the following code to protect/unprotect each sheet in a workbook:
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Unprotect "PASSWORD"
End With
Next ws
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
With ws
.Protect "PASSWORD"
End With
Next ws
I figured that I could also use it for charts that I have set up as separate tabs however it does not seem to be working. Is there any way to set up code to protect every tab in an open workbook?
Any help would be appreciated...thanks!