Home |
Search |
Today's Posts |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
No, there is not any specific event, BUT you can achieve that with a little
effort: * In ThisWorkbook declare a module variable to hold the last deactivated sheet * do little programming in SheetDeactivate and SheetActivate events to verify the last deactivated sheet is still alive: code sample in ThisWorkbook: Private mOldSheetName As String Private Sub Workbook_SheetActivate(ByVal Sh As Object) Dim oldFound As Boolean Dim ws As Worksheet oldFound = False For Each ws In Worksheets If ws.Name = mOldSheetName Then oldFound = True Exit For End If Next If Not oldFound Then Debug.Print "Sheet deleted: " & mOldSheetName End If End Sub Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) mOldSheetName = Sh.Name End Sub " wrote: Is any event raised when a sheet gets deleted? I'd like to remove a control button upon certain sheets being removed. Thanks, James |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Detecting when a user deletes a row | Excel Programming | |||
Detecting when a user deletes a row | Excel Worksheet Functions | |||
Detecting when Excel user inserts or deletes a row | Excel Programming | |||
Detecting user idle time | Excel Programming | |||
Detecting when user deselects an add-in | Excel Programming |