I want to run a sort on the active sheet regardless of what sheet is active. How do I rewrite the following without a sheet name so that it will just run on the sheet that is active when the macro is called to run. I want to get rid of "Master Daily calc" and have the macro just run on the sheet that is active at the time.
Code:
Range("B5:E37").Select
ActiveWorkbook.Worksheets("Master Daily calc").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Master Daily calc").Sort.SortFields.Add Key:=Range _
("B5:B37"), SortOn:=xlSortOnValues, Order:=xlAscending, DataOption:= _
xlSortNormal
With ActiveWorkbook.Worksheets("Master Daily calc").Sort
.SetRange Range("B4:E37")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
Comment