SORT BY COLOR


Posted by Jiminey Dehey on February 08, 2002 12:18 PM

Can cells be sorted by font color. I have red, magenta, and black fonted cell in a list. I want a sort so that red on top, magenta next, then black. Help please. thanks

Posted by JACK IN THE UK on February 08, 2002 1:18 PM

Best example i have ever seen www.ozgrid.com even a download[NT]

Posted by jiminey dehdy on February 08, 2002 4:26 PM

I CANT FIND ANYTHIING - HELP

Thanks, but I can't find what I am looking for on that site. Can you be more specific.

Posted by DK on February 08, 2002 4:54 PM

Link is in here ; -)

Posted by DK on February 08, 2002 4:55 PM

ooops, no it isn't. http://www.ozgrid.com/vba/sort.htm



Posted by Jack in the UK on February 08, 2002 5:11 PM

This is Dave Hawley UDF Code and Ivan F Moalas help ... Cheers Guys

heres just what you need my graet friend Dave Hawleys work on www.ozgrid.com with Ivan F Moala's amendments
>>>>>>>>>>>>>>>>>>. Thsi is from the feed 19659.html on MrExcel

Cheers Dave and Ivan

rdgs
Jack in the UK

>>>>>>>>>> BTW refer to the same ULR for ozgrid if need more details..

Re: Sort text by color??

--------------------------------------------------------------------------------

[ Follow Ups ] [ Post Followup ] [ Mr Excel's Message Board for Excel Help ] [ FAQ ]

--------------------------------------------------------------------------------

Posted by Ivan F Moala on February 01, 2002 at 16:39:06:

In Reply to: Re: Sort text by color?? posted by Jason on February 01, 2002 at 14:30:54:

Do as dave has suggested but use the UDF
for the fonts;

Function ColourRankFont(ColorOrder As Range, LookCell As Range)
'''''''''''''''''''''''''''''''''''''''''''''
'Written by OzGrid Business Applications
'www.ozgid.com

'Ranks a list of Colors so they can be sorted
'Amended for Font colours 2/2/2002
'''''''''''''''''''''''''''''''''''''''''''''

Dim i As Integer
Dim ICol1 As Integer
Dim ICol2 As Integer

i = 1
ICol2 = -1
ColourRankFont = 0

'Loop until match is found
Do Until ICol1 = ICol2
ICol1 = ColorOrder(i, 1).Font.ColorIndex
ICol2 = LookCell.Font.ColorIndex
If i = ColorOrder.Rows.Count + 1 Then
'No Match found place in Text
ColourRankFont = "No colour match!!!"
Exit Do
End If
'Pass the Row number of the colour match
ColourRankFont = i
i = i + 1
Loop
End Function


HTH

Ivan