ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Sort Range by Font Color (https://www.excelbanter.com/excel-programming/417135-sort-range-font-color.html)

RyanH

Sort Range by Font Color
 
I am looking for an easy way to sort a range by font color. The range is
made up of 14 columns and I want to sort by Col. 12. Col. 12 has empty
cells, cells with font color index = 15 and cells with font color index =
xlAutomatic. I want to delete all the rows that don't have a font color
index = xlAutomatic in Col. 12. I currently have a loop that does this, but
it takes a long time.

I figure if I can sort all font color index = xlAutomatic to the top I can
quickly delete everything underneath very easily. Is there a way to sort by
font color? I know you can do it in 2007, but what about 2003?
--
Cheers,
Ryan

joel

Sort Range by Font Color
 
Deleting always takes a long time when you delete one row at a time. To
speed the code, put an X in the rowss you want deleted in an auxilary column.
Then sort the worksheet using the auxilary column as the key in Descending
order. Then delete the rows with an X. You'll probably get 100 times
improvement in execution speed.

"RyanH" wrote:

I am looking for an easy way to sort a range by font color. The range is
made up of 14 columns and I want to sort by Col. 12. Col. 12 has empty
cells, cells with font color index = 15 and cells with font color index =
xlAutomatic. I want to delete all the rows that don't have a font color
index = xlAutomatic in Col. 12. I currently have a loop that does this, but
it takes a long time.

I figure if I can sort all font color index = xlAutomatic to the top I can
quickly delete everything underneath very easily. Is there a way to sort by
font color? I know you can do it in 2007, but what about 2003?
--
Cheers,
Ryan



All times are GMT +1. The time now is 06:33 AM.

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