+ Reply to Thread
Results 1 to 4 of 4

Sorting Question

  1. #1
    runningdog
    Guest

    Sorting Question

    Hi.

    When I sort a selection by a column that contains blanks the rows with
    blanks always sort to the end regardless whether I set ascending or
    descending. Is there anyway to reverse this?

    Selection.Sort Key1:=Range("B11"), Order1:=xlAscending, Key2:=Range("M11"
    _
    ), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
    _
    False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
    DataOption2 _
    :=xlSortTextAsNumbers

    Column B contains a either 'X' or ''
    Column M contains a number

    and I want the rows with an 'X' at the bottom of the list.

    TIA Steve

    PS Using Office 2003 pro



  2. #2
    Dave Peterson
    Guest

    Re: Sorting Question

    Maybe you could put something in those blank cells, then sort, then remove the
    blanks.

    Record a macro when you do your Edit|replaces and you can add them before and
    after your sort.

    (Use a unique value--so you don't change real data!)

    Alternatively, you could sort, then move those rows to where you want them.

    runningdog wrote:
    >
    > Hi.
    >
    > When I sort a selection by a column that contains blanks the rows with
    > blanks always sort to the end regardless whether I set ascending or
    > descending. Is there anyway to reverse this?
    >
    > Selection.Sort Key1:=Range("B11"), Order1:=xlAscending, Key2:=Range("M11"
    > _
    > ), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1, MatchCase:=
    > _
    > False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
    > DataOption2 _
    > :=xlSortTextAsNumbers
    >
    > Column B contains a either 'X' or ''
    > Column M contains a number
    >
    > and I want the rows with an 'X' at the bottom of the list.
    >
    > TIA Steve
    >
    > PS Using Office 2003 pro


    --

    Dave Peterson

  3. #3
    CLR
    Guest

    Re: Sorting Question

    You could use a helper column, insert this formula and copy down

    ="aaaa"&A1

    then highlight both columns and sort on the helper column

    Vaya con Dios,
    Chuck, CABGx3


    "runningdog" <[email protected]> wrote in message
    news:#[email protected]...
    > Hi.
    >
    > When I sort a selection by a column that contains blanks the rows with
    > blanks always sort to the end regardless whether I set ascending or
    > descending. Is there anyway to reverse this?
    >
    > Selection.Sort Key1:=Range("B11"), Order1:=xlAscending,

    Key2:=Range("M11"
    > _
    > ), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,

    MatchCase:=
    > _
    > False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
    > DataOption2 _
    > :=xlSortTextAsNumbers
    >
    > Column B contains a either 'X' or ''
    > Column M contains a number
    >
    > and I want the rows with an 'X' at the bottom of the list.
    >
    > TIA Steve
    >
    > PS Using Office 2003 pro
    >
    >




  4. #4
    runningdog
    Guest

    Re: Sorting Question

    Thanks I hid the helper column and sort on it works good.

    "CLR" <[email protected]> wrote in message
    news:#vHNg#[email protected]...
    > You could use a helper column, insert this formula and copy down
    >
    > ="aaaa"&A1
    >
    > then highlight both columns and sort on the helper column
    >
    > Vaya con Dios,
    > Chuck, CABGx3
    >
    >
    > "runningdog" <[email protected]> wrote in message
    > news:#[email protected]...
    > > Hi.
    > >
    > > When I sort a selection by a column that contains blanks the rows with
    > > blanks always sort to the end regardless whether I set ascending or
    > > descending. Is there anyway to reverse this?
    > >
    > > Selection.Sort Key1:=Range("B11"), Order1:=xlAscending,

    > Key2:=Range("M11"
    > > _
    > > ), Order2:=xlAscending, Header:=xlGuess, OrderCustom:=1,

    > MatchCase:=
    > > _
    > > False, Orientation:=xlTopToBottom, DataOption1:=xlSortNormal,
    > > DataOption2 _
    > > :=xlSortTextAsNumbers
    > >
    > > Column B contains a either 'X' or ''
    > > Column M contains a number
    > >
    > > and I want the rows with an 'X' at the bottom of the list.
    > >
    > > TIA Steve
    > >
    > > PS Using Office 2003 pro
    > >
    > >

    >
    >




+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1