Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi Mike,
As Jim says no event is directly triggered when a sheet is renamed. What you could do is get a cell formula to return the sheet name which in turn will trigger the sheet calculate event if the sheet is renamed =MID(CELL("filename",A1),FIND("]",CELL("filename",A1))+1,31) the file must have been saved for the formula to work If the formula is in say A1, you would need to store the original value of A1, either in some other cell or as a module level variable (first time in say the workbook open or activate event). If, in the calculate event, the value of A1 has changed call your code and update the stored value. Note if code called in the calculate event goes on to trigger another calculation you'll need to early exit the code triggered event(s). FWIW if you want to return all sheet names you could try this named formula - =MID(NOW()*0 & GET.WORKBOOK(1), FIND("]", GET.WORKBOOK(1))+2,31) Array enter the named formula in a row of cells, as many as there will ever likely be sheets in the workbook (or transpose if you prefer in a column). This array entered named formula will also change if sheet is re-ordered, added or deleted (which might be useful and/or require extra work to cater for) Similar to the above, store the array of values for comparison in the calculate event. Regards, Peter T "Mike Archer" wrote in message ... Hello - is there an event or a good way to invoke code when a sheet is renamed? -- Thanks, Mike |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Rename tab on cell event | New Users to Excel | |||
Rename Sheet Event | Excel Programming | |||
How to simulate worksheet rename event | Excel Programming | |||
How can i trap the rename event of an excel sheet? | Excel Programming |