Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when changing the sheet
I would like a macro to run every time the user changes of sheet.
Not when a cell is selected or changed, but immediately after changing the sheet. I want it to run also when a new sheet is added to the workbook. Thank you in advance. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when changing the sheet
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) Put your macro here End Sub "S. G." wrote: I would like a macro to run every time the user changes of sheet. Not when a cell is selected or changed, but immediately after changing the sheet. I want it to run also when a new sheet is added to the workbook. Thank you in advance. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when changing the sheet
Put these in ThisWorkbook
Private Sub Workbook_NewSheet(ByVal Sh As Object) MsgBox ("New") End Sub Private Sub Workbook_SheetActivate(ByVal Sh As Object) MsgBox ("Activated :") & Sh.Name End Sub "Mike" skrev: Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) Put your macro here End Sub "S. G." wrote: I would like a macro to run every time the user changes of sheet. Not when a cell is selected or changed, but immediately after changing the sheet. I want it to run also when a new sheet is added to the workbook. Thank you in advance. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
changing sheet size | New Users to Excel | |||
Changing the name of a sheet | Excel Discussion (Misc queries) | |||
changing tab name on the bottom of an Excel sheet by macro | Excel Programming | |||
Changing target sheet name wihtin a macro | Excel Discussion (Misc queries) | |||
Changing Sheet Name | Excel Programming |