Home |
Search |
Today's Posts |
#7
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
That worked perfectly. I'd really like to understand the code. Would you
mind explaining why it works? Is UserResponse a special type of object? Regards, Lee "Rick Rothstein" wrote: Same code, different color property... Sub DeleteRedFontRows() Dim UserResponse As Variant On Error GoTo NoRedFonts Application.ScreenUpdating = False Application.FindFormat.Font.Color = vbRed Do Columns("A").Find("*", SearchFormat:=True).EntireRow.Delete Loop NoRedFonts: Application.ScreenUpdating = True End Sub Note the I used the VB built in constant vbRed instead of using an RGB function call to produce the same value. -- Rick (MVP - Excel) "Lee" wrote in message ... Hmmm, that didn't work for me. Perhaps the problem is that I have a different color of Red than ColorIndex 3. This works: Sub DeleteRowsWithRedFont() Dim row As Integer For i = 2 To 81 If Range(Cells(i, 1), Cells(i, 1)).Font.Color = RGB(255, 0, 0) Then Rows(i).Delete shift:=xlUp End If Next End Sub However, I like your method better since there is less looping. Do you know how to relate RGB to ColorIndex colors? Regards, Lee "Lee" wrote: I have 80 rows of data and and one of the columns contains the serial number of the row (i.e. 1 through 80). The serial number font is normally black but if the font is red, I need to find the row number to delete that row. Does anyone know how to do that? It would be nice to do it without looping to save time. Thanks in advance, |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Conditional Format for font color using font color | Excel Worksheet Functions | |||
Delete text when font is color black | Excel Programming | |||
Changing Font color based on font type or size | Excel Discussion (Misc queries) | |||
Check Font or Font color and take action | Excel Programming | |||
My fill color and font color do not work in Excel Std Edition 2003 | Excel Discussion (Misc queries) |