Thread: deleting sheet
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jacob Skaria Jacob Skaria is offline
external usenet poster
 
Posts: 8,520
Default deleting sheet

Try the Workbook close event..From VBE double click 'ThisWorkbook'

Private Sub Workbook_BeforeClose(Cancel As Boolean)

OR

get the Sheet DeActivate event of the 3rd sheet
Private Sub Worksheet_Deactivate()


If this post helps click Yes
---------------
Jacob Skaria


"Seeker" wrote:

I have a workbook with 3 work sheets, first tab is for data input, second tab
is for data maintain, third tab is macro auto add sheet which extract data
from data maintain sheet for reporting purpose. I would like to delete the
third sheet when either users switch to other tab or closing workbook. I get
the €śdelete€ť code but dont know the code when users switch tab or close book.

Application.DisplayAlerts = False
Sheets("Print").Delete
Application.DisplayAlerts = True