Home |
Search |
Today's Posts |
#1
|
|||
|
|||
[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
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Run macro on exit worksheet/workbook | Excel Worksheet Functions | |||
Macro: Exit active workbook without save? | Excel Worksheet Functions | |||
on exit macro | Excel Discussion (Misc queries) | |||
Playing a macro from another workbook | Excel Discussion (Misc queries) | |||
Date macro | Excel Discussion (Misc queries) |