View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
SIGE SIGE is offline
external usenet poster
 
Posts: 206
Default Trigger macro when nr of sheets changes

Hi Bob,

Thank you!
1. I am wondering though why it stumps when:
after adding 1 sheet ... you delete this one.

Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)
If ThisWorkbook.Sheets.count < NumSheets Then
NumSheets = ThisWorkbook.Sheets.count
MsgBox "A sheet has been added/deleted"
End If
End Sub

2. I have a workbook with 2 sheets (1 veryhidden =infosheet to Enable
macro's). I do add sheets upon opening.
Though your "Private Sub Workbook_SheetDeactivate(ByVal Sh As Object)"
triggers already...


Brgds Sige

PS: Just for my curiosity: What happened to the "Purbecks"?