PC Review


Reply
Thread Tools Rate Thread

Color sorting

 
 
mnckishore@gmail.com
Guest
Posts: n/a
 
      23rd Sep 2008
1) Can any one please provide me code to sort colors by selection in
excel.
 
Reply With Quote
 
 
 
 
Bob Bridges
Guest
Posts: n/a
 
      23rd Sep 2008
Not sure what you mean. There are two ways to indicate colors: 1) by RGB
code (a hex value), or by the index of the square in the color palette, a
window showing various colors in a grid. If you want a list of the color
palette's indices they are, simply, 1, 2, 3 etc. If you want a list of the
RBG colors, they're pretty much the same thing.

I'm betting you don't want to sort the colors at all; you want to sort a
bunch of rows in a worksheet by one of the colors in that row or one of its
cells. If so, first of all, which color? There are background, font and
four border colors, at least; which one do you want to sort the rows on?

Let's assume it's the background color of one of the cells within each row
-- col A, let's say. I thought maybe you could do it without a VBA program
at all -- maybe there would be an Excel function that would discern the
background color of A1, so you could do that in another column and sort on
that -- but I looked and I don't see any worksheet function that will tell
you another cell's color. So the best way to do it, I think, will be to have
your program go through A1 through A999-or-whatever, get the index or RGB
color value (whichever you want) of that cell and put that color code in,
say, col Z of the same row. Once you've done that, sort the range by col Z,
then delete the color codes from Z1:Z999-or-whatever.

How's that? Will that do what you want?

--- "(E-Mail Removed)" wrote:
> Can any one please provide me code to sort colors by selection in excel?

 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting CF Color Johnny1r Microsoft Excel Worksheet Functions 3 16th Mar 2008 11:34 AM
Sorting by color =?Utf-8?B?RkFSQVogUVVSRVNISQ==?= Microsoft Excel Misc 2 28th Dec 2006 10:58 PM
SORTING BY COLOR =?Utf-8?B?TWFyc2hhbGwgU2NtaWR0?= Microsoft Excel Programming 3 15th Aug 2006 12:10 PM
Sorting by color? =?Utf-8?B?RGF2ZUBQZW5za2U=?= Microsoft Excel Worksheet Functions 3 12th Nov 2004 07:13 PM
sorting by color RobBlue Microsoft Excel Misc 1 25th Aug 2003 09:21 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 04:19 PM.