Sub Sort_D_Then_B()
ActiveWorkbook.Worksheets("Per Capita").Sort.SortFields.Clear
Sort_D_Then_B
s)
ActiveWorkbook.Worksheets ("Per Capita").Sort.SortFields.Add Key:=Range(_ "D:D"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=
x1SortNormal
ActiveWorkbook.Worksheets ("Per Capita").Sort.SortFields. Add Key:=Range(
"B:B"), Sorton:=xlSortOnValues, Order:=xlAscending, DataOption:=
x1SortTextAsNumbers
With ActiveWorkbook.Worksheets ("Per Capita").Sort
'.SetRange Rows (ActiveCells)
.Header = xlGuess
.MatchCase = False
.Orientation = x1TopToBottom
.SortMethod = xlPinyin
.Apply
ActiveCell.Offset(1, 0).Select
End With
End Sub.
For some reason it's not sorting it. It doesn't run into an error anymore. And I got it to select one cell afterwards just to clear the full selection. But it does not sort it at all.
ActiveWorkbook.Worksheets("Per Capita").Sort.SortFields.Clear
Sort_D_Then_B
s)
ActiveWorkbook.Worksheets ("Per Capita").Sort.SortFields.Add Key:=Range(_ "D:D"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=
x1SortNormal
ActiveWorkbook.Worksheets ("Per Capita").Sort.SortFields. Add Key:=Range(
"B:B"), Sorton:=xlSortOnValues, Order:=xlAscending, DataOption:=
x1SortTextAsNumbers
With ActiveWorkbook.Worksheets ("Per Capita").Sort
'.SetRange Rows (ActiveCells)
.Header = xlGuess
.MatchCase = False
.Orientation = x1TopToBottom
.SortMethod = xlPinyin
.Apply
ActiveCell.Offset(1, 0).Select
End With
End Sub.
For some reason it's not sorting it. It doesn't run into an error anymore. And I got it to select one cell afterwards just to clear the full selection. But it does not sort it at all.