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: 74
Default date out of control

Could anyone tell me why I can not control the date format in excel 2002
please
The problem I have is that I have dates created as
20010926
20010927
20010928
20011001
20011002
etc and I want to convert them to dates in the format
26/09/2001
27/09/2001
28/09/2001
01/10/2001
02/10/2001
etc
I have the following code
For ind = 2 To lastRow
yy = Left(Cells(ind, "a").Value, 4)
mm = Mid(Cells(ind, "a").Value, 5, 2)
dd = Right(Cells(ind, "a").Value, 2)

Cells(ind, "a").Value = dd & "/" & mm & "/" & yy
Next ind

When I run this the result is

26/09/2001
27/09/2001
28/09/2001
10/01/2001
10/02/2001

ie, all days <13 are rightjustified and formatted mm/dd/yyyy
and all other days are left justified and formatted dd/mm/yyyy

Why wont excel do as I tell it? - I want all my dates formatted as
dd/mm/yyyy and I dont care whether the are left or right justified.
Thanks
Chris


 
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 picker control Ricardo F Excel Discussion (Misc queries) 2 October 20th 08 03:44 PM
Required Date picker control Vinod[_2_] Excel Discussion (Misc queries) 2 September 20th 08 03:49 PM
Date and Time Picker Control Andy T Excel Discussion (Misc queries) 0 January 6th 05 04:09 PM
Date Control using Spinner Stan Excel Programming 6 October 11th 04 11:17 AM
calendar/date control peter Excel Programming 1 June 9th 04 04:02 PM


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