I have text in Col F (various categories) from row 2 onwards (Headers in in row1) and values in Col G
I would like a macro to sort Col F from row2 onwards in Ascending order and then to sort the values for each of the categories from Largest to smallest
I have written code to do this, but get a run time error 1004 "Sort method of range class failed"
It would be appreciated if someone could kindly amend my code
I would like a macro to sort Col F from row2 onwards in Ascending order and then to sort the values for each of the categories from Largest to smallest
I have written code to do this, but get a run time error 1004 "Sort method of range class failed"
Code:
Selection.Sort Key2:=Range("F2"), Order1:=xlDescending
Code:
Sub Sort_Largest()
Sheets(3).Select
Dim Lr As Long
Lr = Cells(Rows.Count, "C").End(xlUp).Row
Range("A2:H" & Lr).Select
Selection.Sort Key1:=Range("G2"), Order1:=xlAscending
Selection.Sort Key2:=Range("F2"), Order1:=xlDescending
End Sub
It would be appreciated if someone could kindly amend my code