• Hi All

    Please note that at the Chandoo.org Forums there is Zero Tolerance to Spam

    Post Spam and you Will Be Deleted as a User

    Hui...

  • When starting a new post, to receive a quicker and more targeted answer, Please include a sample file in the initial post.

Delete Conditional Format in D:D if "OPEN" Appears in C:C

dparteka

Member
The code below deletes conditional formatting in the entire row if "OPEN" appears in column-C, I'm trying to figure out how to get it to delete only in Column-D. For example, if C5 and C8 are the only ones that have “OPEN” in them then CF would be deleted in only D5 and D8. Any help will be very much appreciated, thanks for looking.

Code:
Sub DeleteConditionalFormat()

Dim Rng As Range
Dim SubRng As Range
Dim SubRow As Integer

Set Rng = Range("C5:C" & Cells(Rows.Count, "C").End(xlUp).Row)
For Each SubRng In Rng

    If SubRng = "OPEN" Then
    SubRng.EntireRow.FormatConditions.Delete
    End If

Next SubRng

End Sub
 
Code:
Sub DeleteConditionalFormat()
Dim SubRng As Range

For Each SubRng In Range("C5:C" & Cells(Rows.Count, "C").End(xlUp).Row).Cells
  If SubRng.Value = "OPEN" Then SubRng.Offset(, 1).FormatConditions.Delete
Next SubRng
End Sub
 
Back
Top