woops forgot to do the columns too
So you can have it in a letter syntax I added a function.
Function Col_Letter(lngCol As Long) As String
Dim vArr
vArr = Split(Cells(1, lngCol).Address(True, False), "$")
Col_Letter = vArr(0)
End Function
Sub ORDER()
'
'ORDER Macro
'
Dim lrow As Integer 'unless a lot, then use long
Dim lcol As String
lrow = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
lcol = Col_Letter(ActiveSheet.Cells(1, Columns.Count).End(xlToLeft).Column)
Range("A1:" & lcol & "1").Select
Range(Selection, Selection.End(xlDown)).Select
ActiveSheet.Sort.SortFields.Clear
ActiveSheet.Sort.SortFields.Add Key:=Range("A1:A" & lrow), SortOn:=xlSortOnValues, ORDER:=xlDescending, DataOption:=xlSortNormal
With ActiveSheet.Sort
.SetRange Range("A1:" & lcol & lrow)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Bookmarks