R
RobWN
I have a number of users using the same macro and part of the macro requires the system date
which it has to separate into its component parts (y,m,d).
My macro is based on English/Canada (short format date yy-mm-dd) and all works well except for
some users who, because of another application they use, require English/USA with the short
format as dd-MMM-yy.
I wrote a routine to determine the format of the date by returning the Application.International
settings Date Order & Separator values which I understood would tell me the short date format
and allow me to break out the date and convert the month to a numeric value.
All appeared well except that during my testing (just for "fun") I tried capturing the system
date using SysDate=Date$ vs. SysDate=Date.
Using May 10, 2008 as an example;
I found that using just DATE gave the correct value 10-May-08 but using DATE$ results in
05-Oct-08.
I've looked at Help as well as Googled until my old eyes gave out and realized that I'm over my
head, as I've always been when it comes to Excel's date manipulations!
My question;
Can anyone shed some light on the difference? I mean I see what it's doing, I just don't know
why it wants to flip the Day & Month in Date$
which it has to separate into its component parts (y,m,d).
My macro is based on English/Canada (short format date yy-mm-dd) and all works well except for
some users who, because of another application they use, require English/USA with the short
format as dd-MMM-yy.
I wrote a routine to determine the format of the date by returning the Application.International
settings Date Order & Separator values which I understood would tell me the short date format
and allow me to break out the date and convert the month to a numeric value.
All appeared well except that during my testing (just for "fun") I tried capturing the system
date using SysDate=Date$ vs. SysDate=Date.
Using May 10, 2008 as an example;
I found that using just DATE gave the correct value 10-May-08 but using DATE$ results in
05-Oct-08.
I've looked at Help as well as Googled until my old eyes gave out and realized that I'm over my
head, as I've always been when it comes to Excel's date manipulations!
My question;
Can anyone shed some light on the difference? I mean I see what it's doing, I just don't know
why it wants to flip the Day & Month in Date$