Hello
I am new to VBA but did a lot of research and a lot of readings in order to create a VBA to my employer.
I have written the code but having some small bugs that you guys might be helpful.
Project:
When you first open my excel sheet, only three pages will be visible( Sheet 1,2 & 11)
I have total of 11 pages; so the rest are hidden.
On Sheet11, I have a command button that will open up a userform.
In this userform, user will enter a number, and based on that it will show the associated hidden file.
Issue:
When I close the document, click on "Save As" and re-open the file, it will revert back to it's original format i.e: Only the first three main sheets are open.
Below is my code that I put inside the workbook. Basically telling it to hide everything except my 3 main sheets.
How to fix this?
Thanks
Ziad
I am new to VBA but did a lot of research and a lot of readings in order to create a VBA to my employer.
I have written the code but having some small bugs that you guys might be helpful.
Project:
When you first open my excel sheet, only three pages will be visible( Sheet 1,2 & 11)
I have total of 11 pages; so the rest are hidden.
On Sheet11, I have a command button that will open up a userform.
In this userform, user will enter a number, and based on that it will show the associated hidden file.
Issue:
When I close the document, click on "Save As" and re-open the file, it will revert back to it's original format i.e: Only the first three main sheets are open.
Below is my code that I put inside the workbook. Basically telling it to hide everything except my 3 main sheets.
Code:
Private Sub Workbook_Open()
Dim wsSheet As Worksheet
Application.ScreenUpdating = False
For Each wsSheet In Worksheets
If wsSheet.Name = "Start" Or _
wsSheet.Name = "Rev Log" Or _
wsSheet.Name = "Instructions" Then
wsSheet.Visible = True
Else: wsSheet.Visible = False
End If
Next wsSheet
Application.ScreenUpdating = True
End Sub
How to fix this?
Thanks
Ziad