Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capture "after delete" Worksheet
Hello,
I'm trying to capture the event after the Excel user deletes specific worksheet. Can it be done? Any help would be appreciated -- Best Regars Rony Boter |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capture "after delete" Worksheet
Hi Rony,
Here is a way. First add this code to a standard code module Public shName As String Sub Deletesheet() Dim oWS As Object On Error Resume Next Set oWS = Sheets(shName) If oWS Is Nothing Then MsgBox shName & " has been deleted" End If End Sub and then add this to the ThisWorkbook code module Private Sub Workbook_SheetDeactivate(ByVal sh As Object) shName = sh.Name Application.OnTime Now + TimeSerial(0, 0, 1), "DeleteSheet" End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Rony Boter" wrote in message ... Hello, I'm trying to capture the event after the Excel user deletes specific worksheet. Can it be done? Any help would be appreciated -- Best Regars Rony Boter |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Capture "after delete" Worksheet
Many thanks Bob,
It help. "Bob Phillips" wrote in message ... Hi Rony, Here is a way. First add this code to a standard code module Public shName As String Sub Deletesheet() Dim oWS As Object On Error Resume Next Set oWS = Sheets(shName) If oWS Is Nothing Then MsgBox shName & " has been deleted" End If End Sub and then add this to the ThisWorkbook code module Private Sub Workbook_SheetDeactivate(ByVal sh As Object) shName = sh.Name Application.OnTime Now + TimeSerial(0, 0, 1), "DeleteSheet" End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Rony Boter" wrote in message ... Hello, I'm trying to capture the event after the Excel user deletes specific worksheet. Can it be done? Any help would be appreciated -- Best Regars Rony Boter |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Excel "Move or Copy" and "Delete" sheet functions | Excel Worksheet Functions | |||
Is there a formula to capture data between "Tabs" on a spreadsheet | Excel Worksheet Functions | |||
VBA to disable "Delete...." on shortcut menu of worksheet tab? | Excel Discussion (Misc queries) | |||
Adding "New" "Insert" "Delete" into a workbook to change from data 1 to data 2 etc | Excel Programming | |||
Make "Worksheet Menu Bar" invisible or Delete/hide it's buttons | Excel Programming |