+ Reply to Thread
Results 1 to 3 of 3

sort by cell fill color

  1. #1
    Forum Contributor
    Join Date
    07-18-2012
    Location
    New York
    MS-Off Ver
    2016
    Posts
    193

    sort by cell fill color

    Hello,

    I'm working on a new macro that I need to group specific unique characters in column A together and then subtotal them. I'm not sure if this is the best way to do it but I was trying to use conditional formatting to highlight the characters that I need and then sort by cell color and cell values to bring them to the top and then sort alphabetically. When I try to record it to a macro it tells me that it can't identify a header row and ends up not sorting it at all and just subtotals. My data looks something like what I have below.


    ya
    ya
    yl
    yl
    ya
    ya
    zp
    zp
    yb
    yb
    ya
    ya


    Basically I need it to look like this

    ya
    ya
    ya
    ya
    ya
    ya
    yl
    yl
    yb
    yb
    zp
    zp

    I need everything with a ya and yl brought to the top and sorted alphabetically and everything else just sorted alphabetically.

    Thanks

  2. #2
    Forum Expert
    Join Date
    04-22-2013
    Location
    .
    MS-Off Ver
    .
    Posts
    4,418

    Re: sort by cell fill color

    well you could use whatever you are using as a conditional format statement as an =IF() formula in the next column to assign 1's and 2's to the ya and yl and then sort by column B.
    If you don't need to group them, you could also use =COUNTIF() to get the subtotals.

  3. #3
    Forum Contributor
    Join Date
    07-18-2012
    Location
    New York
    MS-Off Ver
    2016
    Posts
    193

    Re: sort by cell fill color

    That should do it, thanks.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Color sort - VBA function works on first cell but not on fill down
    By SeanBee in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 02-17-2012, 12:12 PM
  2. [SOLVED] Sort by Fill Color
    By Elaine in forum Excel General
    Replies: 7
    Last Post: 01-27-2010, 05:11 AM
  3. Sort or sub-total by Fill color or font color
    By Excel_seek_help in forum Excel General
    Replies: 1
    Last Post: 04-27-2006, 04:10 PM
  4. [SOLVED] Can I sort Excel sheet by the color of the fill in selected cell
    By hg in forum Excel Formulas & Functions
    Replies: 1
    Last Post: 03-13-2006, 10:40 PM
  5. [SOLVED] Excel sort by Fill Color by custom list sort
    By Dash4Cash in forum Excel General
    Replies: 2
    Last Post: 07-29-2005, 06:05 PM

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