Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when sheet name changes
I need to run a macro when sheet name changes.. how to do this?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when sheet name changes
hi
so far as i know, there is no sheet name change event to trigger a macro to run. what are we trying to do? regards FSt1 "Kash" wrote: I need to run a macro when sheet name changes.. how to do this? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Run a macro when sheet name changes
Do you mean when a user actually changes the name of a worksheet or when a
user selects a different worksheet. If the former then I don't think there is an event associated with it. If the latter then in the VBA editor on the left side there is the project explorer. Double click ThisWorkbook. At the top of the section where the code goes there are 2 drop down boxes. Click the DropDown arrow of the box on the left. Click the dropdown of the box on the right. Select either SheetActivate or SheetDeactivate. The sub name and end sub will be created. When writing the code, sh is the sheet that was either activated or deactivated depending on which sub you use. Example: msgbox sh.Name 'Returns the sheet name -- Regards, OssieMac "Kash" wrote: I need to run a macro when sheet name changes.. how to do this? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Macro to lookup a sheet, number, then display in origonal sheet | New Users to Excel | |||
Help to code Macro to Copy fron one sheet and paste in other sheet | Excel Programming | |||
Return to Current Sheet in On (sheet activate) event macro | Excel Programming | |||
2 questions, copying data from sheet to sheet and assigning macro | Excel Worksheet Functions | |||
excel - macro code to open a protected sheet, enter passowrd, and then protect sheet | Excel Programming |