Sheet Rename event capture

V

Venkat

Hi,

Is there any event/way to know when a sheet is being renamed? I want to
capture sheet rename and execute some code. But it seems there is no way to
capture this. Is there any alternative solution for this?

Thanks in Advance.
 
H

Harlan Grove

Venkat said:
Is there any event/way to know when a sheet is being renamed? I want to
capture sheet rename and execute some code. But it seems there is no way to
capture this. Is there any alternative solution for this?

If you have formulas that refer to cells in every worksheet, changing
worksheet names would trigger recalculation. However, determining
whether worksheet renaming triggered recalc would be tricky since
you'd need to maintain a list of worksheets in the workbook including
the worksheet's index within the worksheet collection and its previous
name.

What sort of code are you trying to run on worksheet rename?
 
R

Roger Govier

Hi

No event that I know of to do this, but you could capture the existing Sheet
name with a Sheet_Activate event.
Store this value in a temp location
Do a Compare of Sheet name against this on the Sheet_Deactivate event, and
use that test to trigger your code.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top