ActiveWorkbook.Worksheets("CountSummary").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("CountSummary").Sort.SortFields.Add Key:=Range( _
"F2:F89"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("CountSummary").Sort
.SetRange Range("A1:Y89")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Dim Ws As Worksheet
Dim LR As Long
'Application.ScreenUpdating = True
Set Ws = ActiveSheet
LR = Ws.Range("B" & Rows.Count).End(xlUp).Row
Ws.Range("A1:P" & LR).Sort Key1:=Ws.Range("A1"), order1:=xlAscending, MatchCase:=False, Header:=xlYes
Sub SortDataOnMultipleColumns()
Dim Ws As Worksheet
Dim LR As Long
Application.ScreenUpdating = False
Set Ws = Worksheets("CountSummary")
LR = Ws.Range("A" & Rows.Count).End(xlUp).Row
Ws.Sort.SortFields.Clear
Ws.Sort.SortFields.Add Key:=Range("F1:F" & LR), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
With Ws.Sort
.SetRange Range("A1:P" & LR)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Application.ScreenUpdating = True
End Sub
Ws.Columns("A:P").Sort key1:=Range("F:F"), order1:=xlAscending, Header:=xlYes
Dim Ws As Worksheet
Dim LR As Long
Application.ScreenUpdating = False
Set Ws = Worksheets("CountSummary")
LR = Ws.Range("A" & Rows.Count).End(xlUp).Row
Ws.Sort.SortFields.Clear
Ws.Columns("A:P").Sort key1:=Range("F:F"), order1:=xlDescending, Header:=xlYes
Please post your full code, its difficult to understand with single line, anyway you can try below code:
Open in new window