View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
MattB[_2_] MattB[_2_] is offline
external usenet poster
 
Posts: 2
Default protecting sheets from a macro

I am running a macro from an option button in a sheet
named "Summary". The macro make s various formatting
changes, but it needs to unprotect the sheet first. I am
running the following code, but the I get a run time error
when it executes. Can any one help?

Password = "Testpassword"
Worksheets("Summary").Select
Worksheets("Summary").Unprotect Password:=Password