R
ryan.fitzpatrick3
I have a workbook where I protected and have certain cells available
for data entry. I have a macro that hides and unhides rows.
Sub Hide()
Rows("19:22").Hidden = Not Rows("19:22").Hidden
Rows("66:69").Hidden = Not Rows("66:69").Hidden
Rows("114:117").Hidden = Not Rows("114:117").Hidden
Rows("158:161").Hidden = Not Rows("158:161").Hidden
Rows("254:257").Hidden = Not Rows("254:257").Hidden
Rows("299:302").Hidden = Not Rows("299:302").Hidden
Rows("341:344").Hidden = Not Rows("341:344").Hidden
Rows("208:210").Hidden = Not Rows("208:210").Hidden
Rows("372:1500").Hidden = Not Rows("372:1500").Hidden
ActiveWindow.SmallScroll Down:=-500
End Sub
Now when the workbook is protected this macro gives me an error, since
the sheet is protected. Is there code where if the sheet is protected
it'll disable this macro and enable it when the sheet isn't protected?
I have this macro in a combo box for a selection to choose from.
Thanks in advance.
ryan
for data entry. I have a macro that hides and unhides rows.
Sub Hide()
Rows("19:22").Hidden = Not Rows("19:22").Hidden
Rows("66:69").Hidden = Not Rows("66:69").Hidden
Rows("114:117").Hidden = Not Rows("114:117").Hidden
Rows("158:161").Hidden = Not Rows("158:161").Hidden
Rows("254:257").Hidden = Not Rows("254:257").Hidden
Rows("299:302").Hidden = Not Rows("299:302").Hidden
Rows("341:344").Hidden = Not Rows("341:344").Hidden
Rows("208:210").Hidden = Not Rows("208:210").Hidden
Rows("372:1500").Hidden = Not Rows("372:1500").Hidden
ActiveWindow.SmallScroll Down:=-500
End Sub
Now when the workbook is protected this macro gives me an error, since
the sheet is protected. Is there code where if the sheet is protected
it'll disable this macro and enable it when the sheet isn't protected?
I have this macro in a combo box for a selection to choose from.
Thanks in advance.
ryan