HotNumbers
Well-known Member
- Joined
- Feb 14, 2005
- Messages
- 732
How do i check to see if a sheet is hidden if so Unhide it if not Hide it? Hide or Unhide
Public Sub SwapVisibility(SomeSheet As Worksheet)
If SomeSheet.Visible = xlSheetVisible Then
SomeSheet.Visible = xlSheetVeryHidden
Else
SomeSheet.Visible = xlSheetVisible
Endif
End Sub
SwapVisibility Sheets("Basics BW")
Sheets("Basics BW").Visible = 1 - Sheets("Basics BW").Visible
Sheets("Basics BW").Visible = (xlVeryHidden + xlSheetVisible) - Sheets("Basics BW").Visible
True, which is why I qualified my code by saying...Rick: when your code encounters a sheet that is just Hidden, not VeryHidden, unexpected things will happen...