Thread: Macro Help
View Single Post
  #1   Report Post  
John
 
Posts: n/a
Default Macro Help

I asked a question yesterday about creating a macro that within it, removes
the protection from the worksheet, does what it is supposed to do, and then
puts the password back on. Someone reasponded with that is below, but
unfortunately that did not work.

I have two worksheets, so I don't know if that is causing the problem. The
macro is supposed to change the format of one cell in one worksheet, then go
to the other worksheet2, change that format to the same thing, then go back
to the original worksheet. Is this possible?

Sub UnProtectSheet()
PWD = "password"
Worksheets("sheet1").Unprotect Password:=PWD
End Sub