ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   New Users to Excel (https://www.excelbanter.com/new-users-excel/)
-   -   Sort rows by color (https://www.excelbanter.com/new-users-excel/148176-sort-rows-color.html)

Chris

Sort rows by color
 
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

Bernie Deitrick

Sort rows by color
 
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


"Chris" wrote in message
...
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




Chip Pearson

Sort rows by color
 
Chris,

Excel 2007 added this capability. For earlier versions, see
http://www.cpearson.com/excel/SortByColor.htm for example code to do this.


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting
www.cpearson.com
(email on the web site)

"Chris" wrote in message
...
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




All times are GMT +1. The time now is 02:04 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com