I am working on a spreadsheet with several tabs & macros. When I close the spreadsheet I want to hide all the tabs except one.
The problem is when I run as it closes the sheets it appears to trigger the macos as it selects the sheets to close them.
I have several sheets that have macros that run when you select a the sheet, so I am assuming that is the issue?
Is there a way to fix that?
Thanks for your help.
Code:
Sub hidesome()
Application.ScreenUpdating = False
Dim ws As Worksheet
For Each ws In Worksheets
If ws.Name <> "Main" Then ws.Visible = xlSheetHidden
Next
Application.ScreenUpdating = True
End Sub
The problem is when I run as it closes the sheets it appears to trigger the macos as it selects the sheets to close them.
I have several sheets that have macros that run when you select a the sheet, so I am assuming that is the issue?
Is there a way to fix that?
Thanks for your help.