ExcelBanter

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

Bob Phillips[_5_]

Sheet Name Change Event?
 
Jerry,

There is no event for this.

If you are worried about a user changing a sheet name that you use in the
code, then use the sheet CodeName instead. If you look in the VB IDE each
sheet has 2 names, the one in brackets is what the user sees, and can
change, the other is the Codename, and cannot be changed by the user. They
both start with the same value.

To use it try

Sheet1.Activate

instead of

Worksheets("Sheet1").Activate

as an example.

--

HTH

Bob Phillips

"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.






All times are GMT +1. The time now is 11:26 AM.

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