Sort rows by color

C

Chris

Is there a way in office 2000 to sort rows by color? I'm not good with code
and cutting and pasting over 1000 rows is becoming tiresome.

Thanks
 
B

Bernie Deitrick

Text color or background color?

Use a UDF - copy and paste this into a codemodule:

Function BGColor(myR As Range) As Integer
BGColor = myR.Interior.ColorIndex
End Function
Function FColor(myR As Range) As Integer
FColor = myR.Font.ColorIndex
End Function


Then use them like so

=BGColor(A2)
=FColor(A2)

depending on whether you want BackGroundColor or FontColor.

Copy the formula down to match your cells, then sort based on that column.

HTH,
Bernie
MS Excel 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