I am using this code and need it modify in case someone modifies the sheet name (so it still works). So the code can run on the active sheet.
Any help is greatly appreciated!
Set Rng = ActiveCell
Application.ScreenUpdating = False
Range("F9:K18").Select
ActiveWorkbook.Worksheets("Item Comparison").sort.SortFields.Clear
ActiveWorkbook.Worksheets("Item Comparison").sort.SortFields.Add2 Key:=Range( _
"J9:J18"), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Item Comparison").sort
.SetRange Range("F9:K18")
.Header = xlGuess
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Range("I8").Select
Application.ScreenUpdating = True
Application.GoTo Rng
End Sub
Bookmarks