It highlights on .Apply
Im not sure what is wrong.
Sub Sort_Review()
Dim FirstCell
Dim LastCell
Dim SortStart
Dim SortEnd
Range("A1").Select
FirstCell = ActiveCell.Address
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
LastCell = ActiveCell.Address
Range("C2").Select
SortStart = ActiveCell.Address
Selection.End(xlDown).Select
SortEnd = ActiveCell.Address
ActiveWorkbook.Worksheets("Review").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Review").Sort.SortFields.Add Key:=Range(SortStart & ":" & SortEnd), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Review").Sort
.SetRange Range(FirstCell & ":" & LastCell)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub
Im not sure what is wrong.
Sub Sort_Review()
Dim FirstCell
Dim LastCell
Dim SortStart
Dim SortEnd
Range("A1").Select
FirstCell = ActiveCell.Address
Selection.End(xlDown).Select
ActiveCell.Offset(0, 1).Select
LastCell = ActiveCell.Address
Range("C2").Select
SortStart = ActiveCell.Address
Selection.End(xlDown).Select
SortEnd = ActiveCell.Address
ActiveWorkbook.Worksheets("Review").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Review").Sort.SortFields.Add Key:=Range(SortStart & ":" & SortEnd), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
With ActiveWorkbook.Worksheets("Review").Sort
.SetRange Range(FirstCell & ":" & LastCell)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub