English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

2 answers

You'd have to use vba.

2006-10-13 09:24:05 · answer #1 · answered by kheserthorpe 7 · 0 0

Create a macro and copy and paste the following code...

Function ColorRank(ColorOrder As Range, LookCell As Range)
'''''''''''''''''''''''''''''''''''''''''''''
'Ranks a list of Colors so they can be sorted
'''''''''''''''''''''''''''''''''''''''''''''

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

i = 1
ICol2 = -1
ColorRank = 0

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

2006-10-13 16:28:54 · answer #2 · answered by gandalf 4 · 0 0

fedest.com, questions and answers