View Single Post
  #3   Report Post  
Posted to microsoft.public.excel.programming
J. Blauth J. Blauth is offline
external usenet poster
 
Posts: 3
Default Check for NumberFormat = DateFormat

Hi Rick,

thanks for a quick reply.
You will need to clarify what you consider a date. Your use of "sth"


sorry. you are perfectly right that I missed to thoroughly define what I
exactly consider to be a valid date format.
a valid date time should be any format of the following:
formats that include
1) day, month, year
2) day, month (this case is only a nice-to-have)
3) hour, minute
4) hour, minute, second
5) day, month, year, hour, minute
6) day, month, year, hour, minute, second
in any possible order and local preference.
So case 1 as an example would contain dd.mm.yy, mm/dd/yyyy (...).

by the way, i used the "sth" as an abbreviation for something ;)

kind regards,
Joe.

Rick Rothstein (MVP - VB) schrieb:
You will need to clarify what you consider a date. Your use of "sth"
(although I'm not sure what the "t" stands for) seems to suggest you
will accept date parts as being date formatted, is that correct? For
example, would a format of mmmm be considered a date format? I ask
because the VB IsDate function would return False for it. So, I am
looking for your complete definition of what would constitute a "date
format".



Rick


"J. Blauth" wrote in message
...
Hi all,
is there a simple way to check if a Range.NumberFormat returns a Date
format ? To be sure I am not misunderstood: the Cell-Values might be
empty but the cells are formatted to a date format. by default it
might be dd/mm/yy or similar but could also return "[$-409]d/m/yy h:mm
AM/PM;@" or sth.
what I am searching for is a simple way to check if the
range.numberformat fits to any possible dateformat. best case would be
"If Range.NumberFormat = IsDateFormat then..." but I cannot seem to
find something like that. Is there an easy solution for that ?
thanks for any kind of hints.

Joe.