Hi anyone,
I'm trying to figure out a way how to make the following code to sort date in column A of the active sheet by the last date on bottom row and the first date on the top row. Meaning in an ascending manner.
My column headers are on row 4. And I have data columns from column A to column I.
At present the code sorts date by the last date on top and first date on bottom. Meaning in an descending manner.
Any help on this would be kindly appreciated.
Thanks in advance.
I'm trying to figure out a way how to make the following code to sort date in column A of the active sheet by the last date on bottom row and the first date on the top row. Meaning in an ascending manner.
Code:
Sub SortDate()
Dim c As Integer
With ActiveSheet.Range("A1").CurrentRegion
c = .Find(What:="Date", After:=.Cells(1, 1), LookIn:=xlFormulas, _
LookAt:=xlPart, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False).Column
.Sort Key1:=.Cells(1, c), Order1:=xlDescending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
End With
End Sub
At present the code sorts date by the last date on top and first date on bottom. Meaning in an descending manner.
Any help on this would be kindly appreciated.
Thanks in advance.