Littlemalky
Board Regular
- Joined
- Jan 14, 2011
- Messages
- 223
I need to sort this group of data. The name of the worksheet is "detail w add"; the top line is the header, naturally, and the columns go from A:V. I need to sort relative to column "V" in Ascending order. The caviot is that this data is ever changing and there is a break in rows that I've created so I can sort just the top portion of the data. I found code that looks like it would work, but I'm getting the error, "Compile error: Expected: list Seperator or )". Is this code wrong?
Code:
Private Sub SecondSort()
Dim LastRow As Integer 'This is the LAST Non Empty Row
LastRow = ActiveSheet.UsedRange.Row - 1 + _
ActiveSheet.UsedRange.Rows.Count
Worksheets("detail w add").Range("A2:V" & LastRow & ").Sort Key:=Worksheets("detail w add").Columns("V"), Order1:=xlAscending
End Sub