View Single Post
  #8   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
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