Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have 6 worksheets in an Excel Workbook. When on click on the "X" to close
the workbook I want a macro to automatically run that hides 3 of the 6 worksheets. Any ideas on how to do this? thanks |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Use the Workbook BeforeClose event like:
ALT+F11 to access VBA Select the Before Close Option and place the required code to hide/display sheets there. Private Sub Workbook_BeforeClose(Cancel As Boolean) Sheet1.Visible = False Sheet2.Visible = true ..... End Sub Corey.... "DM - NPS" wrote in message ... I have 6 worksheets in an Excel Workbook. When on click on the "X" to close the workbook I want a macro to automatically run that hides 3 of the 6 worksheets. Any ideas on how to do this? thanks |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Run a macro on exit | Excel Programming | |||
Run macro on exit | Excel Discussion (Misc queries) | |||
If statement and exit macro | Excel Programming | |||
Exit via macro only? | Excel Discussion (Misc queries) | |||
on exit macro | Excel Discussion (Misc queries) |