+ Reply to Thread
Results 1 to 7 of 7

Code for sorting by icolor numbers or background color

  1. #1
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Code for sorting by icolor numbers or background color

    I have this as my code for coloring cells based on words in column g, is there a code for sorting by icolor number to group all colors together? basically sort by color? I'm using excel 2000 if that matters....

    Please Login or Register  to view this content.

  2. #2
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Code for sorting by icolor numbers or background color

    Can you post a dummy file?

  3. #3
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Code for sorting by icolor numbers or background color

    Here you are
    Book2.xls

  4. #4
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Code for sorting by icolor numbers or background color

    The custom function will give you the background color index. Insert a new column and extract the background color for each row, then sort by the back color index #

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Code for sorting by icolor numbers or background color

    Thanks but for some reason when i open the sheet you attached nothing works now. i change somethign in column g and the colors don't change. Should the sort happen automatically? or do i have to do a manual sort? I would like to either click a button to sort or have it done automatically once I change the color.

  6. #6
    Forum Expert
    Join Date
    12-15-2009
    Location
    Chicago, IL
    MS-Off Ver
    Microsoft Office 365
    Posts
    3,177

    Re: Code for sorting by icolor numbers or background color

    The custom function is going to give you the cell's background color index #. You are going to have insert a helping column and then sort by color index #.

  7. #7
    Registered User
    Join Date
    01-12-2010
    Location
    south bend, in
    MS-Off Ver
    Excel 2000
    Posts
    31

    Re: Code for sorting by icolor numbers or background color

    Sorry if this sounds dumb but I have no idea what a helping column is or how to use the custom function. I just know when I open the sheet you attached when I try to change something in column G nothing happens except for the word changing, no numbers change, no color change or anything. No offense but you just repeated your self and didn't answer any of my questions I asked before I've never written vba code before so I'm clueless on that.

+ 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