Jonathan King
New Member
- Joined
- Dec 13, 2018
- Messages
- 17
A simple sort routine is being used across a number of reports, but there's a few instances where the sort begins on the second row (row 13) and the not the first (row 12). It's strange, because the same code works fine in the majority of cases.
Any ideas?
Thanks in advance!
Sheets("Department").Select
Range("B12:D27").Select
ActiveWorkbook.Worksheets("Department").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Department").Sort.SortFields.Add2 Key:= _
Range("C12:C27"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Department").Sort
.SetRange Range("B12:D27")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Any ideas?
Thanks in advance!
Sheets("Department").Select
Range("B12:D27").Select
ActiveWorkbook.Worksheets("Department").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Department").Sort.SortFields.Add2 Key:= _
Range("C12:C27"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption _
:=xlSortNormal
With ActiveWorkbook.Worksheets("Department").Sort
.SetRange Range("B12:D27")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With