R
Ron Rosenfeld
Excel 2007 / VBA 6.5
Is it possible to delete a single conditional format? (My goal is to delete
all except 2.
I have tried to do so (code below) and receive a 1004 error.
When recording a macro while deleting two of the formats, it appears to delete
ALL of the formats, and then recreate the formats that remain.
Here is the code I tried:
=============================
Private Sub Worksheet_Activate()
Dim i As Long
With Worksheets("solver").Cells
If .FormatConditions.Count > 2 Then
For i = 1 To .FormatConditions.Count - 2
.FormatConditions(i).Delete
Next i
End If
End With
End Sub
===========================
--ron
Is it possible to delete a single conditional format? (My goal is to delete
all except 2.
I have tried to do so (code below) and receive a 1004 error.
When recording a macro while deleting two of the formats, it appears to delete
ALL of the formats, and then recreate the formats that remain.
Here is the code I tried:
=============================
Private Sub Worksheet_Activate()
Dim i As Long
With Worksheets("solver").Cells
If .FormatConditions.Count > 2 Then
For i = 1 To .FormatConditions.Count - 2
.FormatConditions(i).Delete
Next i
End If
End With
End Sub
===========================
--ron