Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 34
Default sort date/time

I have the following code which worked great when I was sorting only
dates....but it won't sort if I have date and time, 04/02/2006 11:00 format.
What do I have to do differently?

Selection.Sort Key1:=Range("B10"), key2:=Range("N10"), Order1:=xlAscending,
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default sort date/time

If the times and dates are in column B, then it is highly likely that you
won't have duplicte times and column N will have little influence on the
sort.

That said, I didn't see any difference in the sort whether it was formatted
to show times or not show times as long as the times were still stored in the
cells.

--
Regards,
Tom Ogilvy


"srroduin" wrote:

I have the following code which worked great when I was sorting only
dates....but it won't sort if I have date and time, 04/02/2006 11:00 format.
What do I have to do differently?

Selection.Sort Key1:=Range("B10"), key2:=Range("N10"), Order1:=xlAscending,
Header:=xlNo, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Reply
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
Converting text format of time/date into Excel time/date for subtr YY san.[_2_] Excel Worksheet Functions 6 February 25th 10 08:27 AM
How do I sort data by date excluding time markd Excel Discussion (Misc queries) 1 January 29th 10 07:28 AM
Calculating days & time left from start date/time to end date/time marie Excel Worksheet Functions 7 December 7th 05 02:36 PM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 02:48 AM
Combined date time cell to separate date & time components Mark Ada Excel Discussion (Misc queries) 1 December 2nd 04 12:07 AM


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