Hello
I try desighn macro by hide all of sheets except "sheet2" but the code hide also "sheet2" and keep the last sheet is showed and gives mismatch error in this line
How can I fix it please?
I try desighn macro by hide all of sheets except "sheet2" but the code hide also "sheet2" and keep the last sheet is showed and gives mismatch error in this line
VBA Code:
Sheets(ws).Visible = xlSheetVeryHidden
VBA Code:
Option Explicit
Sub nn()
Dim ws As Worksheet
For Each ws In Sheets
If ws.Name <> "Sheet2" Then
Sheets(ws).Visible = xlSheetVeryHidden
End If
Next
End Sub