I am trying to delete a row if a cell in column A is a certain color. I searched all over the internet and found a lot of hits, but none that seem to work, or none that are easy to edit so that I can make them work the way I want (I am still a beginner in VBA).
The most basic and straight forward code I found and editted is pasted below. However, after testing it it doesn't work. I don't get any errors but it doesn't delete any rows. The code is going to be inserted in a big macro that does a lot of other formatting tasks such as deleting and inserting column and rows so I know I have to insert an End if when I get there.
I am using Excel 2010.
Any help is appreciated.
Thanks!
The most basic and straight forward code I found and editted is pasted below. However, after testing it it doesn't work. I don't get any errors but it doesn't delete any rows. The code is going to be inserted in a big macro that does a lot of other formatting tasks such as deleting and inserting column and rows so I know I have to insert an End if when I get there.
I am using Excel 2010.
Any help is appreciated.
Thanks!
Code:
Sub test()
If Columns("A:A").Interior.Color = RGB(255, 0, 0) Then Rows.Delete
End Sub