Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default US - British Dates

I have a Userform where the user enters a date in british format (dd/mm/yyyy)
and the date is then copied to excel. My problem is that excel interperts it
as US dates for example if the user enters 09/12/2008 the vba copies it to
excel as 12/09/2008. I've tried Cstr before i.e Range("A1").Value =
Cstr(TextDate.Value) and also the Format function as in Range("A1").Value =
Format(TextDate.Value,"dd/mm/yyyy"), but non of this seems to do the trick.

--
A. Ch. Eirinberg
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,501
Default US - British Dates

Try this

mypart = Split(Textdate.Text, "/")
Range("a1").Value = _
DateSerial(mypart(2), mypart(1), mypart(0))

Mike

"Howard31" wrote:

I have a Userform where the user enters a date in british format (dd/mm/yyyy)
and the date is then copied to excel. My problem is that excel interperts it
as US dates for example if the user enters 09/12/2008 the vba copies it to
excel as 12/09/2008. I've tried Cstr before i.e Range("A1").Value =
Cstr(TextDate.Value) and also the Format function as in Range("A1").Value =
Format(TextDate.Value,"dd/mm/yyyy"), but non of this seems to do the trick.

--
A. Ch. Eirinberg

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
Euro & British pound symbol issue djd Excel Discussion (Misc queries) 1 April 30th 07 11:34 PM
How can I change Excel to use the British date system? EddieA Excel Discussion (Misc queries) 3 July 25th 06 12:56 PM
How do I calculate and display in British Pounds and/or Euros? Staeger Excel Discussion (Misc queries) 4 June 12th 06 09:19 PM
currency icon (british pounds) hrh frank Excel Discussion (Misc queries) 6 April 28th 05 10:13 AM


All times are GMT +1. The time now is 08:25 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"