hi guys used the recorder for this
basically sorting column A from "Z to A" and then adding another sort after ...sorting column "R" from oldest to newest...and I'm highlighting columns A to T first before I use the ribbon to sort.
i'm not confident in cleaning up the code, so would like some help please.
Code:
finalrow = Cells(Rows.Count, "A").End(xlUp).Row
ActiveWorkbook.Worksheets("Domestic NI").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Domestic NI").Sort.SortFields.Add Key:=Range( _
"A10:A" & finalrow), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
ActiveWorkbook.Worksheets("Domestic NI").Sort.SortFields.Add Key:=Range( _
"R10:R" & finalrow), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Domestic NI").Sort
.SetRange Range("A10:T" & finalrow)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
basically sorting column A from "Z to A" and then adding another sort after ...sorting column "R" from oldest to newest...and I'm highlighting columns A to T first before I use the ribbon to sort.
i'm not confident in cleaning up the code, so would like some help please.
Last edited: