I want to hide all tabs whose names are "ABC", "DEF", "GHI"
This is my code:
Sub hideSheets()
Dim ws As Worksheet
invisible = Array("ABC", "DEF", "GHI")
For Each ws In ActiveWorkbook.Worksheets
For Each nome In invisible
If ws.Name = nome Then
ws.Visible = False
Else
ws.Visible = True
End If
Next nome
Next ws
End Sub
Which isn't hiding any sheet.
=instead of true or false.xlSheetHidden = 0, which is exactly equivalent to False ,xlSheetVisible = -1which is exactly equivalent to True. So those two visible states can and often are achieved by using the simple Boolean values.xlSheetVeryHidden = 2which can be set either with the constant or the literal or an expression. In any case, nothing from that other question addresses this question.