Hello,
Wondering of someone can help me clean this up a little and make it dynamic as the used range is not always going to be ending at Z281. I've tried other code found on this site, but none of it seemed to work with my sheet. Data in rows 1-2 is a title and statistics, row 3 contains header.
Wondering of someone can help me clean this up a little and make it dynamic as the used range is not always going to be ending at Z281. I've tried other code found on this site, but none of it seemed to work with my sheet. Data in rows 1-2 is a title and statistics, row 3 contains header.
Code:
Range("W4").Select ActiveWorkbook.Worksheets("Data").Sort.SortFields.Clear
ActiveWorkbook.Worksheets("Data").Sort.SortFields.Add Key:=Range("W4"), _
SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:= _
xlSortTextAsNumbers
With ActiveWorkbook.Worksheets("Data").Sort
.SetRange Range("A3:Z281")
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin
.Apply
End With
End Sub