Consulting

Results 1 to 6 of 6

Thread: Solved: Need to sort Excel by Colored Row, and Cell values

  1. #1
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location

    Solved: Need to sort Excel by Colored Row, and Cell values

    I need a way to Sort (Col 1) Empty Cell *No Color* 1st, Then Empty Blue 2nd, Then Blue with Value = "S"
    (and each sort group sorted by Job Number in Col 2)

    I've attached a sample before and after workbook.

    I pref this to work in both Excel 2003 and 2007, but I can live with a just a 2007 version if the 2003 is very complicated.

    Thanks so much for your help

    Edit: replaced attachment with Rev2 version because I had the row height code too small
    Last edited by frank_m; 11-27-2010 at 12:11 PM.

  2. #2
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Ron de Bruin has a solution at http://www.rondebruin.nl/table.htm
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  3. #3
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location
    Hi xld

    I really need to try hard to avoid an add-in for deployment reasons. I know Excel 2007 has more sorting options than 2003 so I'm ok only using 2007. - I'll do some googling for sorting by colored rows and see if I can get something close to what I'm after coded, instead of asking you to do it all.

    I'll post back later for some help or work around ideas when I get that far

    Thanks again.

    (I replaced the attachment in my first post because the first version had code that was setting the row height too small)

  4. #4
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Excel 2007/2010 has the option to sort by cell colour, it is in the Values dropdown.

    In Excel 2003, the technique is to create a helper column and get the cell colour via a UDF, and sort by the helper column. I describe it in http://www.xldynamic.com/source/xld....r.html#sorting
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

  5. #5
    VBAX Expert
    Joined
    Sep 2010
    Posts
    604
    Location
    Thanks xld

    Your 2003 technique looks very promising. I'll try playing with that first as it will be great to have it work in both 2003 and 2007

    Many compliments to you for how clearly you explained your technique at the link you gave. Things like that make us slow minded struggles live a lot longer and enable us to have more time for smiles.

    xldynamic.com certainly is an appropriate name

  6. #6
    Distinguished Lord of VBAX VBAX Grand Master Bob Phillips's Avatar
    Joined
    Apr 2005
    Posts
    25,453
    Location
    Quote Originally Posted by frank_m
    xldynamic.com certainly is an appropriate name
    LOL!. I am not the creative type, and thought long and hard to come up with an appropriate name, that was the best I could come up with

    When I created my blog, I named it 'Excel Do, Dynamic Does'. I have no more idea than the next guy what it means, but it was the first thing that entered my head, so I went with it.
    ____________________________________________
    Nihil simul inventum est et perfectum

    Abusus non tollit usum

    Last night I dreamed of a small consolation enjoyed only by the blind: Nobody knows the trouble I've not seen!
    James Thurber

Posting Permissions

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