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: 26
Default Date Format Problem

I have the following bit of code below that for some reason when run a
message box displays 01/02/2005 as it should but when the value is placed in
a cell it changes to 02/01/2005. I have tried this with month 03, 04 etc and
still the same. I have tried formatting the cell before hand and even
afterwards it thinks its 2nd Jan 2005 rather than 1st Feb 2005 (British
region).
Any ideas anyone???

Thanks
MC
---------------------------
Sub WRITEDATE()
Dim dateandtime As String

dateandtime = "01/02/2005 08:35"
date1 = Left(dateandtime, 10)
MsgBox date1 'to test
Cells(1, 1) = date1 'have tried cells(1,1).value=date1 but same results

End Sub
---------------------
 
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
Date Format Problem Alain Excel Discussion (Misc queries) 2 May 31st 10 04:53 PM
Excel Format Problem - Date Overrides Format Mary Excel Discussion (Misc queries) 5 February 10th 10 05:49 AM
Problem with Date format Lise Excel Discussion (Misc queries) 2 August 18th 09 12:21 AM
date format problem?? Steve[_9_] Excel Discussion (Misc queries) 10 December 27th 07 11:23 PM
Date format problem Vass Excel Worksheet Functions 7 April 3rd 06 04:50 PM


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