Unfortunately there's no worksheet_delete event but there is a workaround.
Alt+f11 - double click This Workbook and paste this in:-
Private sheetname As String
Private Sub Workbook_SheetActivate(ByVal Sh As Object)
Dim sheet As Worksheet
For Each sheet In Worksheets
If sheet.Name = sheetname Then
ok = True
Exit For
End If
Next
If Not ok Then
MsgBox sheetname & " has been deleted" 'Your code goes here
End If
End Sub
Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
sheetname = Sh.Name
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.