ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sorting by date (https://www.excelbanter.com/excel-programming/312489-re-sorting-date.html)

Simon Lloyd[_575_]

Sorting by date
 

Not sure what you want but try this, where columns ("A:A") enter you
column range and so on this is simple code to sort in ascending orde
from A1 or enter your first cell you want to sort from.

Hope this helps!

Simon

Here's the code......

Sub datesort()
'
' datesort Macro


'
Columns("A:A").Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending
Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
ActiveCell.Select
End Su

--
Simon Lloy
-----------------------------------------------------------------------
Simon Lloyd's Profile: http://www.excelforum.com/member.php...nfo&userid=670
View this thread: http://www.excelforum.com/showthread.php?threadid=26637



All times are GMT +1. The time now is 12:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com