Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
toontje
 
Posts: n/a
Default [Fwd: Run macro on exit worksheet/workbook]



-------- 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?
  #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?



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Run macro on exit worksheet/workbook toontje Excel Worksheet Functions 3 August 2nd 05 10:15 PM
Macro: Exit active workbook without save? Don Excel Worksheet Functions 0 May 20th 05 06:47 AM
on exit macro ditchy Excel Discussion (Misc queries) 2 May 3rd 05 12:11 AM
Playing a macro from another workbook Jim Excel Discussion (Misc queries) 1 February 23rd 05 10:12 PM
Date macro Hiking Excel Discussion (Misc queries) 9 February 3rd 05 12:40 AM


All times are GMT +1. The time now is 09:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"