View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
K Dales[_2_] K Dales[_2_] is offline
external usenet poster
 
Posts: 1,163
Default Macro and Protected Sheet Problem

Just turn protection off temporarily for the sheet:
Sub YourMacro()
Worksheets("SheetName").Unprotect
' macro code here
Worksheets("SheetName").Protect
End Sub
--
- K Dales


"Daniel R. Young" wrote:

I have macros that hide rows and I want to protect my sheet so individuals
will not be able to change any of the information. When the sheet is
protected the macro will not work. It goes to a debuger.

Is there a way to run my macros even though the sheet is protected?

Thank you,

Daniel