J
J.W. Aldridge
Hi.
I found a code that works fine when hiding my sheets, but when I try
to unhide them, I cant get anywhere.I get the following code:
Runtime error 1004. Unable to set the property of the worksheet class
Anything wrong with my code?
Please help.
Sub unHideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET",
"PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Unprotect Password:="pcp123"
.Visible = xlSheetVisible
End With
Next
End Sub
///////////////////////////////////////////////
The code I used to hide them was:
//////////////////////////////////////////////
Sub HideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET",
"PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Protect Password:="pcp123"
.Visible = xlVeryHidden
End With
Next
End Sub
I found a code that works fine when hiding my sheets, but when I try
to unhide them, I cant get anywhere.I get the following code:
Runtime error 1004. Unable to set the property of the worksheet class
Anything wrong with my code?
Please help.
Sub unHideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET",
"PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Unprotect Password:="pcp123"
.Visible = xlSheetVisible
End With
Next
End Sub
///////////////////////////////////////////////
The code I used to hide them was:
//////////////////////////////////////////////
Sub HideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET",
"PRODUCTION")
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Protect Password:="pcp123"
.Visible = xlVeryHidden
End With
Next
End Sub