Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.misc
|
|||
|
|||
before close event with condition
I'm a bit familiar with workbook event Workbook_BeforeClose.
I only want to run a msgBox if cell G2 has a certain value (unbalanced) when the workbook is closed. How can I do this? Cheers, Harold |
#2
Posted to microsoft.public.excel.misc
|
|||
|
|||
before close event with condition
I'm a bit familiar with workbook event Workbook_BeforeClose.
The only code you'd need is this line in the Workbook_BeforeClose: if range("g2").value = "unbalanced" then msgbox("This analysis does not balance.") Please try that, and let us know if you require anything else. Dave O Eschew Obfuscation |
#3
Posted to microsoft.public.excel.misc
|
|||
|
|||
before close event with condition
On Nov 21, 9:59 am, Dave O wrote:
I'm a bit familiar with workbook event Workbook_BeforeClose. The only code you'd need is this line in the Workbook_BeforeClose: if range("g2").value = "unbalanced" then msgbox("This analysis does not balance.") Please try that, and let us know if you require anything else. Dave O Eschew Obfuscation This works ok. Thanks! Is there also a way to create the msgbox with a cancel option to be able to go back and change the sheet. Cheers, Harold |
#4
Posted to microsoft.public.excel.misc
|
|||
|
|||
before close event with condition
No, once you click the X or click File Close the file is going to
close. You might set up another event to warn the user, such as On Save, or set the file so that cell A1 of every tab is painted red until the analysis is balanced. |
#5
Posted to microsoft.public.excel.misc
|
|||
|
|||
before close event with condition
Dave
Incorrect. You can stop the closing of workbook. See other posts in this thread. Gord Dibben MS Excel MVP On Tue, 20 Nov 2007 17:53:49 -0800 (PST), Dave O wrote: No, once you click the X or click File Close the file is going to close. You might set up another event to warn the user, such as On Save, or set the file so that cell A1 of every tab is painted red until the analysis is balanced. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
lookup with multiple condition, but one condition to satisfy is en | Excel Worksheet Functions | |||
why do all excel worksheets/workbooks close when I close one? | Excel Discussion (Misc queries) | |||
event macro on a condition | Excel Discussion (Misc queries) | |||
Excel shoud not close all active books when clicking close button | Excel Discussion (Misc queries) | |||
excel - Windows close button (x) should only close active workboo. | Setting up and Configuration of Excel |