View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
Mark Ivey Mark Ivey is offline
external usenet poster
 
Posts: 25
Default If I have a work sheet protected and try to run a macro to hide rows or columns it won't work. Correct?

I believe you are correct, but there are other options.

Take for instance... you can have your macro unprotect your sheet - run your macro - and then reprotect your sheet.

Sub MyMacro()
Dim Password 'This line of code is optional
Password = "1234"
ActiveSheet.Unprotect Password

~~ Your macro code goes here ~~

ActiveSheet.Protect Password, True, True, True
End Sub

--
Mark Ivey
"Marc" wrote in message nk.net...
Marc