View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 1,560
Default Protect Chart Sheet

I have a macro that protects all the worksheets in a workbook, but not the
chart sheets. I need for it to protect them as well. Can anyone help? Here is
the code I use to protect the worksheets and workbook:

Application.ScreenUpdating = False

Dim password As String

password = Application.InputBox(prompt:="What Password Do You Want To Use?",
Type:=2)
If password = "" Then
'do nothing
Else
For Each ws In Worksheets
ws.Activate
ActiveSheet.Protect (password)
Next ws
End If

Application.ThisWorkbook.Protect (password), structu=True
Worksheets("Global & Monthly Inputs").Activate
Range("A1").Select
Application.ScreenUpdating = True

Thanks!