Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Worksheet_Delete event?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Worksheet_Delete event?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,298
Default Worksheet_Delete event?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 21
Default Worksheet_Delete event?

Many thanks for your responses!

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 92
Default Worksheet_Delete event?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
Event Procedures: Event on Worksheet to fire Event on another Worksheet Kathryn Excel Programming 2 April 7th 04 07:35 PM
change event/after update event?? scrabtree23[_2_] Excel Programming 1 October 20th 03 07:09 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 10:26 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"