Hiden sheet code - need access
»Gary Keramidas« <GKeramidasATmsn.com wrote:
would help if we knew these were the only sheets in the workbook, but:
Sub unHideModeratelyWell2()
Dim shArray As Variant
Dim i As Long
shArray = Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")
Thanks, you just gave me the answer to my thread "VBA - array or
collection literals?"... so the MakeArray function isn't even needed.
However, I'll now stick to using the ParamArray anyway.
For i = LBound(shArray) To UBound(shArray)
With Sheets(shArray(i))
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
Next
End Sub
Simplifying it a bit:
Sub unHideModeratelyWell2()
Dim s As String
For Each s In Array("INFO SHEET", "ROSTER", "TIMESHEET", "PRODUCTION")
With Sheets(s)
.Unprotect Password:="ThisIsBreakable"
.Visible = xlSheetVisible
End With
Next
End Sub
should do it.
|