Why does this not work?
Code:
Sub Macro1()
'
' Macro1 Macro
LR = Cells(Rows.Count, "A").End(xlUp).Row
SN = ActiveSheet.Name
Cells.Select
ActiveWorkbook.Worksheets(SN).Sort.SortFields.clear
ActiveWorkbook.Worksheets(SN).Sort.SortFields.Add Key:=Range("A1:A" & LR) _
, SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets(SN).Sort
.SetRange Range("A1:c" & LR)
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Last edited by a moderator: