PDA

View Full Version : Solved: sorting a single column



ProteanBeing
01-07-2008, 09:28 AM
I am having issues sorting the contents of a column. The amount of items in the column vary. This is the syntax I am using:

Worksheets("NC Tag Data Page").Range("B1:B60000").Sort _
Key1:=Range("B1"), _
Order1:=xlAscending, _
Header:=xlYes

Bob Phillips
01-07-2008, 09:29 AM
Why not just sort the whole column



Worksheets("NC Tag Data Page").Range("B:B").Sort _
Key1:=Range("B1"), _
Order1:=xlAscending, _
Header:=xlYes

ProteanBeing
01-07-2008, 09:35 AM
The issue is that I get the following error:

Run-time error '1004':

The sort reference is not valid. Make sure that it's within the data you want to sort, and the first Sort By box isn't the same or blank.

ProteanBeing
01-07-2008, 09:44 AM
Figured out

Key1:=worksheets("NC Tag Data Page").range("B2")