PDA

View Full Version : Solved: Sort columns



Nosstech
09-03-2008, 07:22 AM
I am trying to sort column A. Excel will sort, but starts at A1 instead of A2. Because of that, my heading is being moved down to the bottom of the spreadsheet. Please help...

Cells.Sort Key1:=Range("A2:A2000")
totalrows = ActiveSheet.UsedRange.Rows.count

lucas
09-03-2008, 08:06 AM
Try this:

Cells.Sort Key1:=Range("A2"), Order1:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal

Nosstech
09-03-2008, 08:34 AM
Thanks, it works great!