How can i trap the rename event of an excel sheet?

B

bmm

Hello,

How can i trap the rename event of an excel sheet?
Is it possible to get the renamed sheet name as soon as it'd changed?

thanks and rgds
 
J

JE McGimpsey

There is no "rename event" in XL. If you have the Cell("filename")
function on the sheet, renaming the sheet will fire the Calculate event,
where you can check the name against a static or global variable.
 
T

Tom Ogilvy

Just to add:
Believe
=Cell("filename")

Will return the name of the activesheet, so you might want to use

=Cell("filename",A1)

the second argument can be any cell reference (on the sheet).
 
J

JE McGimpsey

Tom -

Do you see any difference in terms of firing a Worksheet_Calculate or
Workbook_SheetCalculate event when a sheet in the workbook is renamed? I
don't with MacXL.

I was just thinking of an event trigger. If the filename is to be used,
your addition is obviously the correct one.
 
T

Tom Ogilvy

If your only intent in using cell was to trigger a calculate event, then I
guess it doesn't make any difference what value it returns.
 
Top