thelostscott
Board Regular
- Joined
- May 7, 2010
- Messages
- 226
Hi all,
I'm having trouble writing the code to hide & unhide an array of worksheets by clicking a "Button" (Macro assigned shape).
I though it would work with something like:
But that freezes up when it tries to identify the array as visible.
Any ideas?
I'm having trouble writing the code to hide & unhide an array of worksheets by clicking a "Button" (Macro assigned shape).
I though it would work with something like:
Code:
Sub Hide_Unhide_Workings()
Application.ScreenUpdating = False
If ActiveWorkbook.Sheets(Array("Download", "Pivot", "Download 2", "Download 3", "#WORKINGS#")).Visible = True Then
ActiveWorkbook.Sheets(Array("Download", "Pivot", "Download 2", "Download 3", "#WORKINGS#")).Visible = xlVeryHidden
Else
ActiveWorkbook.Sheets(Array("Download", "Pivot", "Download 2", "Download 3", "#WORKINGS#")).Visible = True
ActiveWorkbook.Sheets("Download 2").Activate
ActiveWorkbook.Sheets("Download 2").Range("E2").Select
End If
Application.ScreenUpdating = True
End Sub
But that freezes up when it tries to identify the array as visible.
Any ideas?