Thread: IsDate Function
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Frank Kabel Frank Kabel is offline
external usenet poster
 
Posts: 3,885
Default IsDate Function

Hi
quite simple :-)
Excel thinks these are valid dates (and somehow is correct with
that...). You can test this if you use
msgbox datevalue(target.value)

so for example:
32/10/04: interepreted as YY/MM/DD and that is 04-Oct-1932

Your second example returns FALSE for me (but this could be something
with regional settings). Try this value with DateValue. what does it
return.

In total you can't do much against it if you use ISDATE. You could
check the individual parts of your entered string


--
Regards
Frank Kabel
Frankfurt, Germany


Don Lloyd wrote:
Hi,

Excel 97, Excel 2003
cell format dd/mm/yy

Q.
In the Worksheet Change routine I have the following code

If IsDate(Target) = False Then
MsgBox
End If

Entries such as 32/10/04, 1/100/04 are quite happily accepted as
dates. Advice gratefully appreciated.

If possible I would rather trap with code rather than using data
validation.

Thanks for any assistance

Don