I have a sub that prioritizes a set of rows across a set of columns based on the sum value in each row.
Where I need help is with limiting the sort to only those rows that have a number (vs. blank) in column A. if Column A is blank, it doesn't sort. If there is, then it does sort. Right now it sorts 10 rows even if there is no data in a row.
Thank you in advance,
Dim xLast_Row As Long
xLast_Row = ActiveCell.Row
If xLast_Row = Cells.Rows.Count Then
MsgBox ("No data found - run cancelled.")
.SortFields.Add Key:=Range("E7:E" & xLast_Row), SortOn:=xlSortOnValues, Order:=xlDescending, DataOption:=xlSortNormal
.SetRange Range("A6:E" & xLast_Row)
.Header = xlYes
.MatchCase = False
.Orientation = xlTopToBottom
.SortMethod = xlPinYin