Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
I have created macros to hide and unhide sheets when clicking on a button
example - Sheets("Premium Labor Utilization").Visible = Not Sheets("Premium Labor Utilization").Visible I am also assigning goups of sheets to a summary button example Application.ScreenUpdating = False Sheets("Premium Labor Utilization").Visible = Not Sheets("Premium Labor Utilization").Visible Sheets("FMLA Compliance").Visible = Not Sheets("FMLA Compliance").Visible Sheets("FLSA Compliance").Visible = Not Sheets("FLSA Compliance").Visible Sheets("Compliance Rpt").Visible = Not Sheets("Compliance Rpt").Visible Sheets("Tangible Savings Summary").Visible = Not Sheets("Tangible Savings Summary").Visible Sheets("Selection Sheet").Select The problem is that if I have already opened a sheet with an idividual button - it will close if I click on a summary button and it is one of the sheets that are part of the summary macro. Is there any way to add some sort of error checking around this so that if a sheet is already open it will not be closed ? -- Thanks Larry |
#2
![]()
Posted to microsoft.public.excel.misc
|
|||
|
|||
![]()
Since I presume your summary button(s) will know what sheets are involved in
the summary, you could be more pro-active in determining what sheets to display and which to hide, as Sheets("InSummary1").Visible=True Sheets("InSummary2").Visible=True Sheets("InSummary3").Visible=True Sheets("NotInSummary1").Visible = False Sheets("NotInSummary2").Visible = False or you can actually test each, as with: If Not Sheets("InSummary1").Visible Then Sheets("InSummary1").Visible=True End If and If Sheets("NotInSummary2").Visible Then Sheets("NotInSummary2").Visible = False End If "Larry Fitch" wrote: I have created macros to hide and unhide sheets when clicking on a button example - Sheets("Premium Labor Utilization").Visible = Not Sheets("Premium Labor Utilization").Visible I am also assigning goups of sheets to a summary button example Application.ScreenUpdating = False Sheets("Premium Labor Utilization").Visible = Not Sheets("Premium Labor Utilization").Visible Sheets("FMLA Compliance").Visible = Not Sheets("FMLA Compliance").Visible Sheets("FLSA Compliance").Visible = Not Sheets("FLSA Compliance").Visible Sheets("Compliance Rpt").Visible = Not Sheets("Compliance Rpt").Visible Sheets("Tangible Savings Summary").Visible = Not Sheets("Tangible Savings Summary").Visible Sheets("Selection Sheet").Select The problem is that if I have already opened a sheet with an idividual button - it will close if I click on a summary button and it is one of the sheets that are part of the summary macro. Is there any way to add some sort of error checking around this so that if a sheet is already open it will not be closed ? -- Thanks Larry |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
need code for hiding/unhiding sheets using checkboxes | Excel Worksheet Functions | |||
unhiding and hiding rows | Excel Discussion (Misc queries) | |||
Hiding & Unhiding graphs... | Charts and Charting in Excel | |||
Hiding and unhiding sheets | Excel Discussion (Misc queries) | |||
Hiding/Unhiding | Excel Worksheet Functions |