ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sheet Name Change Event? (https://www.excelbanter.com/excel-programming/274670-re-sheet-name-change-event.html)

Bob L.

Sheet Name Change Event?
 

"Jerry Park" wrote in message
. ..
Is there an event which will trigger when a worksheet's name is changed?

I want to show/hide some columns depending on the name of the worksheet.
The Workbook_SheetActivate() event will almost do what I want, but I
really need to just know when the name changes.

(The worksheets are named by month and year. When a new sheet is created
from, for example, 'August 2003' and renamed 'September 2003', I want to
hide the column which represents September 31, 2003.)

Thanks.


I'm not aware of such an event. Maybe you should consider automating
the creation of the new sheet in code so you can then control how it
happens, e.g. with a button somewhere called "Make sheet for next month"
which would then run the necessary code. Another option might be to keep
track of sheet names on a worksheet somewhere and then check each time the
sheet of interest is activated to see if its name has changed. Then do
the update and update the sheet name. Problem with this approach (as you
point out), though is that it would lag the actual event, not happening
until the next time the sheet was activated which would be sort of crude.
Hope this helps.

Bob L.




All times are GMT +1. The time now is 03:43 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com