makeitwork09
Technical User
I am using Excel 2007
I do not understand why I had to add 1 to the row in order to get it so include the last row in the range in the sort. RowNum is equal to the last row in the range, however, without adding 1 in the statement below, the last row stays where it was even though it was the highest value in the range.
Thanks
I do not understand why I had to add 1 to the row in order to get it so include the last row in the range in the sort. RowNum is equal to the last row in the range, however, without adding 1 in the statement below, the last row stays where it was even though it was the highest value in the range.
Code:
Dim RowNum As Long
RowNum = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Worksheets("CSHomePrice_History").Range("A3:W" & RowNum + 1).Sort Key1:=Range("A3:A" & RowNum + 1), Order1:=xlDescending, _
Header:=xlYes, MatchCase:=False, _
Orientation:=xlTopToBottom, SortMethod:=xlPinYin
Thanks