vba sort multiple columns

The solution for “vba sort multiple columns” can be found here. The following code will assist you in solving the problem.

‘ Sorts a range with multiple criterias
Sub MultipleColumnsSort()
With ActiveSheet.Sort
.SetRange Range(“A1:D10”)
.SortFields.Add Key:=Range(“A1”), Order:=xlAscending
.SortFields.Add Key:=Range(“B1”), Order:=xlDescending
‘ If range includes headers
.Header = xlYes
.Apply
End With
End Sub

Thank you for using DeclareCode; We hope you were able to resolve the issue.

More questions on [categories-list]

Similar Posts