Sorting by color?

D

Dave@Penske

Is there a way to sort your worksheet data by the color of the individual
cells?
 
S

Scott

Here's a solution to sort by any type of format.

1. In visual basic, paste in this code.

Function CellFormat(cell_to_test As Range) As String
CellFormat = cell_to_test.Font.Color & " " & cell_to_test.Interior.Color
& " " & cell_to_test.Font.Size & " " & cell_to_test.Font.FontStyle
End Function

2. Insert a column into your spreadsheet called something to the effect of
"Cellformat."
3. =cellformat(H7) is now the function to identify your formatting based on
your macro definition in step 1.
4. The output of your new funtion will be: 0 10092543 10 Regular, 0 16777164
10 Regular,16711680 16777215 10 Bold
5. You can now sort on this CellFormat column.
 

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