L
Legacy 146660
Guest
Hi I am lookig for a VBA code or a way where if i can add a new sheet to my active workbook and it will still make all the sheets very hidden expect one (named).
I have written this macro but it is falling over as it is trying to make all sheets very hidden and excle wont all all sheets hidden.
Sub VeryHidden()</SPAN>
Dim sSheetName As String</SPAN>
For Each wsSheet In ActiveWorkbook.Worksheets</SPAN>
If wsSheet.Name = "Sheet1" Then wsSheet.Visible = xlSheetVisible</SPAN>
If wsSheet.Visible = xlSheetVisible Then</SPAN>
wsSheet.Visible = xlSheetVeryHidden</SPAN>
End If</SPAN>
Next wsSheet</SPAN>
End Sub</SPAN>
Please can anyone help ....
I have written this macro but it is falling over as it is trying to make all sheets very hidden and excle wont all all sheets hidden.
Sub VeryHidden()</SPAN>
Dim sSheetName As String</SPAN>
For Each wsSheet In ActiveWorkbook.Worksheets</SPAN>
If wsSheet.Name = "Sheet1" Then wsSheet.Visible = xlSheetVisible</SPAN>
If wsSheet.Visible = xlSheetVisible Then</SPAN>
wsSheet.Visible = xlSheetVeryHidden</SPAN>
End If</SPAN>
Next wsSheet</SPAN>
End Sub</SPAN>
Please can anyone help ....
Last edited by a moderator: