+ Reply to Thread
Results 1 to 11 of 11

Sort rows by cell color

  1. #1
    Forum Contributor
    Join Date
    11-05-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    181

    Sort rows by cell color

    The rows in my data are one of three colors (Red, Yellow, or Green). Is there a way I can sort my rows by color- red on top, then yellow and then green?

  2. #2
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Sort rows by cell color

    Why not sort by the criteria that established the colors.

    An alternative solution can be found here: http://www.datapigtechnologies.com/f...rtonColor.html
    Alan עַם יִשְׂרָאֵל חַי


    Change an Ugly Report with Power Query
    Database Normalization
    Complete Guide to Power Query
    Man's Mind Stretched to New Dimensions Never Returns to Its Original Form

  3. #3
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort rows by cell color

    Where did the colors come from to begin with? Conditional formatting?
    HTH
    Regards, Jeff

  4. #4
    Forum Contributor
    Join Date
    11-05-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    181

    Re: Sort rows by cell color

    rows are colored based on a column in the data. VBA does the conditional formatting

  5. #5
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort rows by cell color

    Quote Originally Posted by Sgligori View Post
    rows are colored based on a column in the data. VBA does the conditional formatting
    In a spare column, can you use that column to add a 1, 2, or 3 to the three colors (Red, Yellow, or Green) and then sort by that new column.

  6. #6
    Forum Contributor
    Join Date
    11-05-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    181

    Re: Sort rows by cell color

    Alan- thanks for the link, but it does not have the information I need. It just shows how to use code to indicate the index color, and then manually sorts it by the color (# of index color).

  7. #7
    Forum Contributor
    Join Date
    11-05-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    181

    Re: Sort rows by cell color

    I'm creating a template for someone and would prefer this step be automated. If anyone is able to point me in the right direction it would be much appreciated!

  8. #8
    Forum Moderator alansidman's Avatar
    Join Date
    02-02-2010
    Location
    Steamboat Springs, CO
    MS-Off Ver
    MS Office 365 Version 2405 Win 11 Home 64 Bit
    Posts
    23,896

    Re: Sort rows by cell color

    rows are colored based on a column in the data.
    Why not sort on this criteria

  9. #9
    Forum Contributor
    Join Date
    11-05-2014
    Location
    Charlotte
    MS-Off Ver
    2013
    Posts
    181

    Re: Sort rows by cell color

    If I knew how to sort based on any criteria I wouldn't ask how to sort based on color.

    Does anyone on this forum know how to sort by color?? Red- Yellow-Green?

  10. #10
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort rows by cell color

    Quote Originally Posted by Sgligori View Post
    If I knew how to sort based on any criteria I wouldn't ask how to sort based on color.

    Does anyone on this forum know how to sort by color?? Red- Yellow-Green?
    You may not believe it, but Alan and I are simply trying to help, but I guess you don't see it.

    We are simply asking, what is the condition you are using to generate the colors? If you can apply CF to generate the color, you should be able to use that same criteria to create a way to sort.

    Example: Let's say Red is generated because column A says "up". Yellow is because column A say "even", and green is column A, "down".

    Now you could use a formula in an empty column to say, =LOOKUP(A2,{"down","even","up"},{3,2,1})

    This would generate your list to sort, but then again, what do I know. I just come here for free...

  11. #11
    Forum Moderator jeffreybrown's Avatar
    Join Date
    02-19-2009
    Location
    Cibolo, TX
    MS-Off Ver
    Office 365
    Posts
    10,316

    Re: Sort rows by cell color

    Your post does not comply with Rule 8 of our Forum RULES. Do not crosspost your question on multiple forums without including links here to the other threads on other forums.

    Cross-posting is when you post the same question in other forums on the web. The last thing you want to do is waste people's time working on an issue you have already resolved elsewhere. We prefer that you not cross-post at all, but if you do (and it's unlikely to go unnoticed), you MUST provide a link (copy the url from the address bar in your browser) to the cross-post.

    Expect cross-posted questions without a link to be closed and a message will be posted by the moderator explaining why. We are here to help so help us to help you!

    Read this to understand why we ask you to do this, and then please edit your first post to include links to any and all cross-posts in any other forums (not just this site).

    http://www.mrexcel.com/forum/excel-q...ell-color.html

+ 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. [SOLVED] VBA to Sort Rows Based on Cell's Backgroun Color/Colour
    By Taisir in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 03-06-2015, 07:09 AM
  2. Want to sort by rows - Cell color
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 04-10-2011, 11:43 PM
  3. Sort rows by number of color cells - Macro Adjusment
    By SVTF in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 04-10-2011, 07:31 AM
  4. Sort rows and color alternating rows using VB
    By drewship in forum Excel Programming / VBA / Macros
    Replies: 12
    Last Post: 11-12-2010, 10:10 AM
  5. Color set of rows according to sort.
    By Ph0ny in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 07-03-2008, 07:17 AM
  6. In Excel it would help a lot to be able to sort rows by color
    By Jeff Watkins in forum Excel General
    Replies: 7
    Last Post: 03-13-2006, 05:10 PM
  7. sort rows by color?
    By blueglass74 in forum Excel General
    Replies: 1
    Last Post: 05-19-2005, 10:16 AM

Tags for this Thread

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