View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Corey Corey is offline
external usenet poster
 
Posts: 363
Default applying worksbook protection via a Macro

Sub ProtectWkbandHideSheets()

ActiveWorkbook.Unprotect Password = "123"
Sheets("Sheet2").Select
ActiveWindow.SelectedSheets.Visible = False
Sheets("Sheet3").Select
ActiveWindow.SelectedSheets.Visible = False
ActiveWorkbook.Protect Password = "123"
End Sub

Change sheets and P/W to suit.

Corey....
"David S" <David wrote in message
...
Can an one tell me how to record a macro that will un-password protect a
workbook then hide several worksheets then re-password protect the workbook?