Is there a way to capture when a sheet is RENAMED? I've got routines that maintain dynamic sheet lists based on adds & deletes, but the RENAME has got me stumped.
Could you not use the Worksheet_Activate() event to store the name of the sheet into a public variable and then use the Worksheet_Deactivate() event to check whether the name has changed and if so run further code to update your list i.e.
Public strName as string
Private Sub Worksheet_Activate()
strName = Activesheet.Name
End Sub
Private Sub Worksheet_Deactivate()
If Activesheet.Name <> strName Then
'Run code to update list
End If
End Sub
MARK: Yeah, that's probably the best way. And by the way, I discovered there were several other threads addressing this same issue. Shoulda done my search first.
Rgds, Geoff [blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
That's a great tip that I can use (I've been stringing together the range portion of the REFERS TO of the NAMES.ADD to change the range).
But, I'm not sure how that's help me keep my list of sheets up to date when sheets are DELETED? Am I missing something.
FYI - My app have several protected sheets (proprietary) and several unprotected user-defined sheets (I lock and unlock the workbook as the user moves around). I need to keep track of the user-defined sheets to drive some in-cell dropdown lists.
Apologies - I misread the question - I thought it was about maintaining range names not sheets as sheet deletions etc can mess up range names
Rgds, Geoff [blue]Si hoc signum legere potes, operis boni in rebus Latinus alacribus et fructuosis potiri potes![/blue]
Want the [red]best[/red] answers to your questions ? faq222-2244
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.