LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Date format


I am using a date field in English format that is then transposing from English to American format for no apparent reason.
Everything starts ok in the English format of DD/MM/YYYY.

The date is entered on a form with

Private Sub UserForm_Initialize()
Dim Today As Date
Today = Date = 05/07/2005 ie 05 July 2005.

' displays on the userform field correctly using
txtOrderDate.Value = Today = "05/07/2005"
'or
txtOrderDate.Value = Format(Today, "dd/mm/yyyy") also = "05/07/2005"

Private Sub Write_the_value_to_a_spreadsheet
Cells(1, 1).Value = txtOrderDate.Value
'or
Cells(1, 1).Value = Format(txtOrderDate.Value, "dd/mm/yyyy")
The spreadsheet displays 07/05/2005 ie 07 May 2005.

But the format options for the cell are showing as Customised "dd/mm/yyyy"
If I change the format of that cell to show the month then May is shown - so the spreadsheet is reading it correctly as English format, so I guess it must be the VBA code that is storing it in American format. I cant see where the transposition is occuring nor how to fix it.

Any ideas ?

Thanks
Andrew

 
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
permanent conversion of 1904 date format to 1900 date format Jos Excel Worksheet Functions 4 November 26th 15 02:48 PM
How do I convert dd/mm/yy date format to yyddd Julian date format itzy bitzy[_2_] Excel Worksheet Functions 8 December 11th 09 03:20 AM
Convert date + time text format to date format Paul Ho Excel Worksheet Functions 2 May 22nd 07 05:47 PM
code to convert date from TEXT format (03-02) to DATE format (200203) Gauthier[_2_] Excel Programming 0 September 22nd 04 03:26 PM
Change a date in text format xx.xx.20xx to a recognised date format concatenator Excel Programming 1 November 24th 03 11:33 PM


All times are GMT +1. The time now is 07:25 AM.

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

About Us

"It's about Microsoft Excel"