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: 85
Default Mixing date formats in VBA

All,

I am stuck trying to solve a problem with mixing date formats.
I am trying to sort an array of strings which represent dates ( "31 Mar 04")
on a system whose short date format is yyyy/mm/dd. Since I want to sort the
date strings in order by date, I used the CDate function in VBA.

The result of CDate("31 Mar 04") is (unfortunately) 2031/04/04, which is not
very useful, considerinbg I would prefer either 2004/03/04, or even better
the date code.

Could someone suggest a technique to convert the date correctly in order to
use in a sorting routine.

Thanks,
Alex J


 
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
Mixing number formats in one cell Craig860 Excel Discussion (Misc queries) 5 March 18th 09 07:58 PM
mixing zip with zip+4 and then sorting JWCrosby Excel Discussion (Misc queries) 2 September 25th 08 08:48 PM
mixing up a list dkb43 Excel Discussion (Misc queries) 1 August 6th 08 08:20 PM
Mixing up the arguments michaelr586 Excel Worksheet Functions 2 September 24th 05 09:54 AM
Mixing chart types E Halliday Charts and Charting in Excel 2 May 16th 05 01:43 PM


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

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"