lezawang
Well-known Member
- Joined
- Mar 27, 2016
- Messages
- 1,805
- Office Version
- 2016
- Platform
- Windows
Hi
I tried to hide the sheets, so I tried the first code and it did work but the second code is tell me I can not hide everything. Why this contradiction? Thank you.
I tried to hide the sheets, so I tried the first code and it did work but the second code is tell me I can not hide everything. Why this contradiction? Thank you.
Code:
Sub nosheets()
ActiveWindow.DisplayWorkbookTabs = False
End Sub
Code:
Sub loopsheet()
y = 2
Dim ws As Worksheet
For Each ws In ThisWorkbook.Worksheets
ThisWorkbook.Worksheets(1).Cells(y, 1).Value = ws.Name
y = y + 1
'*** this part to hide sheet
ws.Visible = xlSheetHidden
Next ws
End Sub