filter the rows which is having the colored text

  • Thread starter Thread starter manoj
  • Start date Start date
M

manoj

I have a set of 310,000 rows which I recieved from somebody and I want to
delete the rows which is having colored text



Can I filter the rows which is having colored text and then delete it
completely??

pls suggest some steps

regards
MAnoj
 
Right click the sheet tab, view code and paste this in. It looks for red text
on column A and deletes the entire row if it finds it

Sub delete_Me()
Dim copyrange As Range
lastrow = Cells(Cells.Rows.Count, "A").End(xlUp).Row
Set myrange = Range("A1:A" & lastrow)
For Each c In myrange
If c.Font.ColorIndex = 3 Then 'Red change to suit
If copyrange Is Nothing Then
Set copyrange = c.EntireRow
Else
Set copyrange = Union(copyrange, c.EntireRow)
End If
End If
Next
copyrange.Delete
End Sub


Mike
 
Back
Top