LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 328
Default Place an IF Statement into a Macro 2007 and 2003

Hi

Within Sub Workbook_BeforeClose I would like an IF statement to check to
cell values within my worksheet. If both conditions are met, prevent the
workbook from closing and send the user a message to tell them to correct the
condition. If the condition does not exist, continue with closing the
workbook

An example of what I'm looking for is based on this formula
=IF(AND(A1="red",B1="blue"), "Red and Blue cannot exists together, please
correct before closing the workbook" etc

I am developing my macros in Excel 2007 and will require them to run on 2003
when I deploy them so would appreciate solutions for both (it may be that
they are the same?)

Thanks
 
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
Using "double equal signs" in place of an IF statement Scott P Excel Worksheet Functions 2 June 21st 06 04:13 AM
adjusting decimal place in protected worksheet in excel 2007 Mike Excel Worksheet Functions 2 June 17th 06 02:34 PM
I need an academic school calendar for 2006-2007 with a place for Dee Excel Discussion (Misc queries) 1 March 24th 06 04:08 PM
How do I override fixed decimal place settings in EXcel 2003? jroyv Excel Worksheet Functions 2 February 11th 05 06:07 PM
How do I create a macro button and place anywhere on my sheet? Vell H. Holcombe, P.E. Excel Discussion (Misc queries) 1 January 20th 05 04:06 PM


All times are GMT +1. The time now is 02:55 AM.

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

About Us

"It's about Microsoft Excel"