Hi,
I'm very new to VBA programming for excel macros and I need some help. I'm trying to get Excel to delete entire rows based on the conditional formating i'm using.
Basically, I want to get rid of all the rows that are of a certain color (let's say green, InteriorColor = 4). I've already come up with a way to delete rows based on color, but I have to take into account the Conditional formating i'm using.
Here's what I already have:
Option Explicit
Sub DeleteGreenRows()
Dim LR As Long, a As Long
Application.ScreenUpdating = False
LR = Cells(Rows.Count, 1).End(xlUp).Row
For a = LR To 1 Step -1
If Cells(a, 1).FormatConditions.InteriorColor = 4 Then
Rows(a).EntireRow.Delete
End If
Next a
Application.ScreenUpdating = True
End Sub
Any help would be awesome. Thanks!
Bookmarks