Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Color sorting

1) Can any one please provide me code to sort colors by selection in
excel.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 257
Default Color sorting

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?

--- " wrote:
Can any one please provide me code to sort colors by selection in excel?

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting CF Color Johnny1r Excel Worksheet Functions 3 March 16th 08 11:34 AM
Sorting by color FARAZ QURESHI Excel Discussion (Misc queries) 2 December 28th 06 10:58 PM
SORTING BY COLOR Marshall Scmidt Excel Programming 3 August 15th 06 12:10 PM
Sorting by color blueglass74 Excel Discussion (Misc queries) 4 February 26th 06 05:21 PM
Sorting by color? Dave@Penske Excel Worksheet Functions 3 November 12th 04 07:13 PM


All times are GMT +1. The time now is 03:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"