On Sat, 11 Jul 2009 13:42:12 +0100, "Peter T" <peter_t@discussions> wrote:
>It might depend on the particular CFs as to whether you can delete them
>individually. However, you won't do it with the code as posted, have a go
>with something like this
>
>Sub test()
>Dim i As Long
>Dim c As Range, r As Range
>
> On Error Resume Next
> Set r =
>Worksheets("sheet1").Cells.SpecialCells(xlCellTypeAllFormatConditions)
> On Error GoTo errExit
>
> If Not r Is Nothing Then
> For Each c In r
> With c.FormatConditions
> If .Count > 2 Then
> For i = .Count To 3 Step -1
> .Item(i).Delete
> Next
> End If
> End With
> Next
> End If
> Exit Sub
>
>errExit:
>' for debugging only
> c.Select
> Debug.Print c.Address
> Stop
> Resume Next
>
>End Sub
>
>Regards,
>Peter T
>
Thanks, Peter.
I'll give it a try.
--ron
|