View Single Post
  #2   Report Post  
Bob Umlas
 
Posts: n/a
Default

Right-Click on the Excel LOGO near the file menu, select View Code, and
select Workbook from the left dropdown (which says "General", and select
BeforeClose from the right-dropdown. You will see:
Private Sub Workbook_BeforeClose(Cancel As Boolean)

End Sub

and you can put your code in there, something like:
Private Sub Workbook_BeforeClose(Cancel As Boolean)
if Msgbox("You Fill in your working hours?",vbyesno+vbquestion)=vbno
then cancel=true
End Sub


Bob Umlas
Excel MVP

"toontje" wrote in message
l...


-------- Original Message --------
Subject: Run macro on exit worksheet/workbook
Date: Tue, 02 Aug 2005 22:47:57 +0200
From: toontje
Organization: Versatel Nederland B.V.
Newsgroups: microsoft.public.excel.worksheet.functions

I am looking for a macro that opens a msgbox when exit the workbook to
remind you
like "you fill in your working hours?"

is that Private Sub AutoClose() ?

and where do i put it?