Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Dates - Days and months switching around

Hello, I'm building a solution that is heavily dependant on dates, the
problem I'm having is in certain situations it's switching the day and month
around. I'm from the UK so we use dd/mm/yy - where as Americans use mm/dd/yy
so I'm guessing it's somehow reverting to American style in VBA somehow.

It's a little bit confusing as I do lots of date checks and sometimes it'll
work correctly and other, seemingly random times it'll switch around.

I'm just wondering if there is a way to specifically make sure - to force
the little swine - to treat all dates as declared as in my regional settings.

Any help given would be appreciated, otherwise I may have to take a
boomstick to the machine. :)

Nate
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Dates - Days and months switching around

cast the date

CDate(Mydatevalue)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"NateBuckley" wrote in message
...
Hello, I'm building a solution that is heavily dependant on dates, the
problem I'm having is in certain situations it's switching the day and
month
around. I'm from the UK so we use dd/mm/yy - where as Americans use
mm/dd/yy
so I'm guessing it's somehow reverting to American style in VBA somehow.

It's a little bit confusing as I do lots of date checks and sometimes
it'll
work correctly and other, seemingly random times it'll switch around.

I'm just wondering if there is a way to specifically make sure - to force
the little swine - to treat all dates as declared as in my regional
settings.

Any help given would be appreciated, otherwise I may have to take a
boomstick to the machine. :)

Nate



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 146
Default Dates - Days and months switching around

Cheers Mr.Phillips, I shall kick myself for not thinking of that and also
taking up your time, but thank you for your speedy reply.



"Bob Phillips" wrote:

cast the date

CDate(Mydatevalue)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"NateBuckley" wrote in message
...
Hello, I'm building a solution that is heavily dependant on dates, the
problem I'm having is in certain situations it's switching the day and
month
around. I'm from the UK so we use dd/mm/yy - where as Americans use
mm/dd/yy
so I'm guessing it's somehow reverting to American style in VBA somehow.

It's a little bit confusing as I do lots of date checks and sometimes
it'll
work correctly and other, seemingly random times it'll switch around.

I'm just wondering if there is a way to specifically make sure - to force
the little swine - to treat all dates as declared as in my regional
settings.

Any help given would be appreciated, otherwise I may have to take a
boomstick to the machine. :)

Nate




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 10,593
Default Dates - Days and months switching around

Being from the UK too, I suffer that VBA 'feature' all the time.

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my addy)



"NateBuckley" wrote in message
...
Cheers Mr.Phillips, I shall kick myself for not thinking of that and also
taking up your time, but thank you for your speedy reply.



"Bob Phillips" wrote:

cast the date

CDate(Mydatevalue)

--
---
HTH

Bob


(there's no email, no snail mail, but somewhere should be gmail in my
addy)



"NateBuckley" wrote in message
...
Hello, I'm building a solution that is heavily dependant on dates, the
problem I'm having is in certain situations it's switching the day and
month
around. I'm from the UK so we use dd/mm/yy - where as Americans use
mm/dd/yy
so I'm guessing it's somehow reverting to American style in VBA
somehow.

It's a little bit confusing as I do lots of date checks and sometimes
it'll
work correctly and other, seemingly random times it'll switch around.

I'm just wondering if there is a way to specifically make sure - to
force
the little swine - to treat all dates as declared as in my regional
settings.

Any help given would be appreciated, otherwise I may have to take a
boomstick to the machine. :)

Nate






Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Number of Months and Days between 2 dates? Jean Excel Worksheet Functions 3 March 30th 07 04:49 PM
Number of years/months/days between 2 dates Deborah Excel Worksheet Functions 4 July 7th 06 11:24 AM
how many months and days between two dates? shopgirl New Users to Excel 1 February 12th 06 08:08 AM
difference between two dates in years, months and days. ruby Excel Worksheet Functions 2 April 4th 05 04:51 PM
How do I calculate how many days in which months given two dates . Nick Rogers Excel Programming 1 November 3rd 04 03:29 PM


All times are GMT +1. The time now is 12:03 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"