thelostscott
Board Regular
- Joined
- May 7, 2010
- Messages
- 226
Hi all,
I'm in need of some help to get a sheet to Hide if visible and Unhide if hidden using a command button click.
I thought I could do something along the lines of:
All this does though is keep it visible and doesn't do the hide bit.
Any ideas?
I'm in need of some help to get a sheet to Hide if visible and Unhide if hidden using a command button click.
I thought I could do something along the lines of:
Code:
Sub Hide_Unhide_Sheet1()
Application.ScreenUpdating = False
If ActiveWorkbook.Sheets("Sheet1").Visible = xlVisible Then
ActiveWorkbook.Sheets("Sheet1").Visible = xlSheetVeryHidden
End If
If ActiveWorkbook.Sheets("Sheet1").Visible = xlSheetVeryHidden Then
ActiveWorkbook.Sheets("Sheet1").Visible = xlVisible
End If
Application.ScreenUpdating = True
End Sub
All this does though is keep it visible and doesn't do the hide bit.
Any ideas?