When I run the following piece of code in Excel 2007 the sort fields are being added (I say that because a manual sort after running the code contains these criteria), but the data is not actually sorted. Suggestions much appreciated. Thanks. Alicia
With ActiveWorkbook.Worksheets("Salary").Sort
.SortFields.Clear
.SortFields.Add Key:=Range("A25:A49"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("G25:G49"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SetRange Range("A25:BU49")
.Orientation = xlTopToBottom
.Apply
End With
With ActiveWorkbook.Worksheets("Salary").Sort
.SortFields.Clear
.SortFields.Add Key:=Range("A25:A49"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SortFields.Add Key:=Range("G25:G49"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SetRange Range("A25:BU49")
.Orientation = xlTopToBottom
.Apply
End With