I want to use VBA to loop through specific Worksheets in order to unhide them if they are hidden. I want to use CodeNames of Worksheets, not Index or Names.
I have tried something like this but it returns error "object required" on line
If HiddenSheets(sCounter).Visible = xlSheetHidden Then
***New info: I am writing this code in separate workbook. I have created a variable for that workbook WB_Master. Maybe I should somehow call sheets from that Workbook by using this variable?
Dim HiddenSheets As Variant
Dim sCounter As Long
HiddenSheets = Array(Sheet4, Sheet5, Sheet6, Sheet25, Sheet26, Sheet27, Sheet33)
For sCounter = LBound(HiddenSheets) To UBound(HiddenSheets)
If HiddenSheets(sCounter).Visible = xlSheetHidden Then
HiddenSheets(sCounter).Visible = xlSheetVisible
End If
Next sCounter