How to sort by colour?

T

Tricia

Does anyone know of an add-in so that I can sort by font colour, rather than
just alphabetically, numerically etc.

I have Word 07
 
D

Doug Robbins - Word MVP

The following will sort a table by the 24 Bit Color that is applied to the
Font of the text in the first column

Dim atable As Table
Set atable = Selection.Tables(1)
With atable
.Columns.Add BeforeColumn:=.Columns(1)
For i = 1 To .Rows.Count
.Cell(i, 1).Range.Text = .Cell(i, 2).Range.Font.Color
Next i
.Sort
.Columns(1).Delete
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
T

Tricia

Thankyou Doug, I am sorry but I am a complete moron and have no idea what to
do with the info you sent. Obviously it is to adjust the registry, but more
than that I wouldn't know what to do with it.


Does anyone know of a way to do it where the text is not in a table form?
 
L

Lilly

Hi Tricia- I am a moron also- LOL. But here goes.Have you tried something
like highlighting. I couldn't say exactly how but I have come across
different color highlights that you can add to the toolbar. Just a thought.
Lilly
 
D

Doug Robbins - Word MVP

If "this is now a feature in Office 2007" is intended to be a statement,
then it is not correct, sorting by colour is not possible without using a
macro in Word 2007. If it is meant to be a question, implying that macros
are a new feature of Word 2007, then that is not correct either as that code
would work in any version of word from Word 97 onwards.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top