Removing conditional formatting if it exists

S

Shaun Allan

On a group of spreadsheets, on the sheet names "Single",
column N sometimes has conditional formatting (2
conditions) that shouldn't be there. How can I get rid of
this in code please?
 
J

JE McGimpsey

One way:

Public Sub RemoveCFinColumnN()
Dim wsSheet As Worksheet
On Error Resume Next
Set wsSheet = Sheets("Single")
On Error GoTo 0
If Not wsSheet Is Nothing Then _
wsSheet.Columns(14).FormatConditions.Delete
End Sub
 
S

Soo Cheon Jheong

Shaun,

Sub TEST()

On Error Resume Next
Worksheets("Single").Columns(5).FormatConditions.Delete

End Sub


--
Regards,
Soo Cheon Jheong
_ _
^¢¯^
--
 
Top