View Single Post
  #6   Report Post  
Posted to microsoft.public.excel.programming
salgud salgud is offline
external usenet poster
 
Posts: 219
Default Days in a month?

On Wed, 30 Jul 2008 10:46:00 -0700, Mike H wrote:

Hi,

Excel doesn't recognise 31/6/2008 as a date but isn't clever enough to do
anything about it, it simply accepts the entry but doesn't automatically
format as a date.

In Vb a date such as that would evaluate as FALSE if you used
IsDate(Range("A1"))

At the worksheet level the formula
=ISNUMBER(A1)
would evaluate as false for an invalid date.

Mike


"salgud" wrote:

I'm working on a macro that looks at dates entered by users. I would like
to be able to require that those dates be real dates. I.e., no June 31. I
know I can enter such a date and XL doesn't question it. Is there any
built-in capability to give an error on such dates, or would I have to
write code and use some kind of lookup to check the validity of each date?
Thanks!


Great! Thanks.