Try something like this. This assumes that your headers are in row 1.
Sub Sort()
Dim aWS As Worksheet
Dim myRange As Range
Dim lRow As Long
Set aWS = ActiveSheet
Set myRange = aWS.Range("A1")
lRow = aWS.Cells(aWS.Rows.Count, myRange.Column).End(xlUp).Row
Set myRange = myRange.Resize(lRow - myRange.Row + 1, 5) '<~~~can change the
# of columns here
myRange.Sort Key1:=Range("B2"), Order1:=xlAscending, Header:=xlGuess, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom, _
DataOption1:=xlSortNormal
End Sub

Signature
HTH,
Barb Reinhardt
> Hello experts,
>
[quoted text clipped - 19 lines]
>
> Eric
Eric - 21 Sep 2007 18:12 GMT
The headers are not in row 1 they are in row 26. I am assuming that this
would change the macro at this point; Set myRange = aWS.Range("A1") change
("A1") to ("A26"). Correct?
Eric
> Try something like this. This assumes that your headers are in row 1.
>
[quoted text clipped - 38 lines]
> >
> > Eric
Eric - 21 Sep 2007 20:38 GMT
Barb,
This command works great with 2 exceptions.
1. What if I want to have a certain contract that I want on top
ie:456 instead of 123. With the macro you gave me it does the contracts in
numerical order.
2. If I have to count the columns backwards how do I do this? Putting in a
negative sign isn't working nor is placing brackets around it.
IE:
Set myRange = aWS.Range("H1")
lRow = aWS.Cells(aWS.Rows.Count, myRange.Column).End(xlUp).Row
Set myRange = myRange.Resize(lRow - myRange.Row + 1,- 5)
I again appreciate all the help. Have a great weekend.
Eric
> Try something like this. This assumes that your headers are in row 1.
>
[quoted text clipped - 38 lines]
> >
> > Eric