Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message box if cell is left empty when run?


Right now I have 2 cells in the top left of my spreadsheet that are se
to be parameters. One is the start date and one is the end date.
would like to know if there is a way to have a message box come up i
someone tries to run the macro without having a date in the box
instead of having it error out.

I know there is a way and it would be an If statement, but not sure ho
it would be written.

Thanks,

~

--
nbaj2
-----------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...fo&userid=3648
View this thread: http://www.excelforum.com/showthread.php?threadid=56698

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 19
Default Message box if cell is left empty when run?

say range 1 and 2 are on Sheet1, "A1" and "A2"...

'Check for start date
If Sheet1.Range("A1") = "" OR (Not IsDate(Sheet1.Range("A1")) then
'Flag message and exit routine
end if

Then do same for end date.

nbaj2k wrote:
Right now I have 2 cells in the top left of my spreadsheet that are set
to be parameters. One is the start date and one is the end date. I
would like to know if there is a way to have a message box come up if
someone tries to run the macro without having a date in the box,
instead of having it error out.

I know there is a way and it would be an If statement, but not sure how
it would be written.

Thanks,

~J


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=566989


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Message box if cell is left empty when run?


thanks! exactly what I needed.

~J


--
nbaj2k
------------------------------------------------------------------------
nbaj2k's Profile: http://www.excelforum.com/member.php...o&userid=36480
View this thread: http://www.excelforum.com/showthread...hreadid=566989

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
If empty, then display message puiuluipui Excel Discussion (Misc queries) 13 October 5th 09 06:44 PM
Message: 'Cannot empty clipboard' Terry Pinnell Excel Discussion (Misc queries) 2 May 27th 09 09:11 AM
Message: Cannot empty clipboard Terry Pinnell Excel Discussion (Misc queries) 2 May 22nd 09 12:39 AM
Display error message if a cell is left blank Another Excel User Excel Discussion (Misc queries) 8 February 11th 08 09:02 PM
Validation - Error message if equals Left formula JICDB Excel Worksheet Functions 6 October 29th 07 08:45 PM


All times are GMT +1. The time now is 04:50 PM.

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"