I have to sort columns in Excel on their values.
I worked out the following procedure:
With calcCalculations
With .Sort
.SortFields.Add Key:=Range("BR2:BR5000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("BV2:BV5000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("CA2:CA5000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("CD2:CD5000"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:=xlSortNormal
.SetRange Range("BR:CD")
.Header = xlYes
.MatchCase = True
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
End With
End with
The procedure does not error out, but it is not sorting my data.