Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Hi there,
Is there such an event like Worksheet_Delete or Chart_Delete? If there isnt any, then how do we know when a worksheet or chart sheet is deleted by user. Regards, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
AFAIK there are no events like that. If it's essential for you to
catch these events then you could instead protect the workbook and provide the user with a button to delete a sheet or chart. Tim "Cool Sport" wrote in message ... Hi there, Is there such an event like Worksheet_Delete or Chart_Delete? If there isnt any, then how do we know when a worksheet or chart sheet is deleted by user. Regards, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
There's a workaround of course. if you record the worksheet that was
deactivated and test for this in the sheet activate event, you can see which sheet was removed in ThisWorkbook code page: Option Explicit Private WSName As String Private Sub Workbook_SheetActivate(ByVal Sh As Object) Dim ws As Worksheet Dim ok As Boolean For Each ws In Worksheets If ws.Name = WSName Then ok = True Exit For End If Next If Not ok Then MsgBox WSName & " has been deleted" End If End Sub Private Sub Workbook_SheetDeactivate(ByVal Sh As Object) WSName = Sh.Name End Sub a better alternative would be toi keep a list of worksheets, graph sheets etc, then on a deactivate event, simple look up whats missing. "Cool Sport" wrote: Hi there, Is there such an event like Worksheet_Delete or Chart_Delete? If there isnt any, then how do we know when a worksheet or chart sheet is deleted by user. Regards, *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Many thanks for your responses!
*** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it! |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
1. Make use of the Deactivate event.
2. You may have already kept a current list of Worksheets ; in the event of Deactivating a worksheet and then it disappears from the list ....... then you know that it's deleted. 3. Look at the archive of this site. It tells plenty ; a treasure trove indeed. 4. Regards. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
user form-on open event? keydown event? | Excel Programming | |||
Event Procedures: Event on Worksheet to fire Event on another Worksheet | Excel Programming | |||
change event/after update event?? | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |