LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3,872
Default Excel is changing date format incorrectly

Hi Garry,

Am Thu, 27 Nov 2014 10:26:20 -0500 schrieb GS:

Range("A1")="01/09/2014"

AFAIK, this is an OS setting! Up to XP Excel's default date format is
dd/mm/yyyy, but since Vista it's been mm/dd/yyyy. That concludes, then,
that this is a 'system' setting for how a date serial gets displayed.


if he writes a DateSerial or a DateValue into the sheet the date will be
displayed with system settings.
But in this case the OP tries to write a string into the cell. That
string is in format (VBA speaks american English) mm/dd/yyyy. So d is 09
and m is 01. In his system he has the format dd/mm/yyyy so month and day
change places.
The only way to avoid this behaviour is to write
DateValue("01/09/2012"). That will be recognized as a date and will be
displayed correctly in his settings


Regards
Claus B.
--
Vista Ultimate / Windows7
Office 2007 Ultimate / 2010 Professional
 
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
Excel changing date format after VB has run Richhall[_2_] Excel Worksheet Functions 3 January 5th 10 04:05 PM
Date format diplays incorrectly esiglin Excel Worksheet Functions 2 September 13th 08 04:00 AM
Excel 2003 - Changing Date Format oceanmist Excel Discussion (Misc queries) 3 August 2nd 07 07:59 PM
Excel 2002 - Date format keeps changing B. Levien Excel Discussion (Misc queries) 0 February 6th 06 09:35 PM
excel is changing date format hubbo Setting up and Configuration of Excel 1 May 18th 05 08:07 PM


All times are GMT +1. The time now is 01:19 PM.

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"