still visible

S

skitek

how to make all sheets invisible and only one visible? Any ideas? (macr
assigned to a button)
th
 
J

JE McGimpsey

One way:

Public Sub HideAllButOne()
Const sVISIBLENAME As String = "VisibleSheetName"
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
Worksheets(Worksheets.Count).Visible = True
For Each wsSheet In Worksheets
With wsSheet
.Visible = (.Name = sVISIBLENAME)
End With
Next wsSheet
Application.ScreenUpdating = True
End Sub
 
Top