View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Listen to "rename sheet" event in excel

Not ideal, but this will pick it up on the next cell select

Private mSheet As String

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If mSheet < "" Then
If Me.Name < mSheet Then
MsgBox "Sheet name changed from " & mSheet
End If
End If
mSheet = Me.Name
End Sub

'This is worksheet event code, which means that it needs to be
'placed in the appropriate worksheet code module, not a standard
'code module. To do this, right-click on the sheet tab, select
'the View Code option from the menu, and paste the code in.



--
---
HTH

Bob

(there's no email, no snail mail, but somewhere should be gmail in my addy)



"Ben" wrote in message
oups.com...
Hi

I'd like to create a listener on the event "sheet.name changing". It
apparently does not exist in vba worksheet standard callbacks.
(said in a different way I want to run a function any time a specific
sheet has its name manually changed)
Any idea ? Any help would be appreciated.

Thanks