LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 35,218
Default Excel VB - Testing Month within a blank cell

In VBA, you can use:

If Range("Start_Date").value = "" Then
(empty or maybe a formula that evaluates to "")

or to test for real emptyness:
If Isempty(Range("Start_Date").value) Then
(no formula, no value)






Dave wrote:

Thanks Robert, Dave, and Mike,

I now understand clearly what is going on and why it is happening with the
date.

Looks like an IsDate or IsBlank test works fine to correct the problem.

Thanks guys,
Dave

"Dave" wrote in message
...
I have two cells in a workbook that are dates. The cell Start_Date has a
valid date in it. The second cell Test_Date is either blank or has a
valid date in it. The IsDate test on both cells works fine, however, on a
blank cell the Month function extracts "12". Anyone know why? I had to
put the month function within a test for IsDate to make it work. Seems
like Month function on a blank cell should return something other than a
12.

Dave



--

Dave Peterson
 
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
MONTH function where cell is blank Lmurraz Excel Discussion (Misc queries) 5 June 4th 07 11:12 AM
Testing for Month in a cell using VBA Rick Excel Programming 1 May 11th 07 12:36 AM
Force date cell to show [blank] if end of month lisa110rry Excel Discussion (Misc queries) 2 January 6th 07 01:33 PM
When using MONTH function on Blank Cell!! Returns Month=Jan! mahou Excel Discussion (Misc queries) 6 January 9th 06 02:46 AM
testing for blank ChuckM[_2_] Excel Programming 2 December 15th 03 06:09 PM


All times are GMT +1. The time now is 02:47 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"