View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Sam Wilson Sam Wilson is offline
external usenet poster
 
Posts: 523
Default Delete Method as it applies to format Condition object


Worksheets("X").Range("A1").FormatConditions(1).De lete

is right - if you get run time error 1004 it's because there are no
conditional format conditions to delete! To avoid that you can use

On error resume next
Worksheets("X").Range("A1").FormatConditions(1).De lete


Sam

"DTP" wrote:

I am trying delete conditional formats for a specific range of cells. The
Help documentation all say to use the Delete Method to delete a
formatcondition but I do not see a specific delete method for Format
conditions. Here are some instances I have tried but all generate errors.
With Worksheets(TargetWS).Range(Cells(5, 5), Cells(TargetRw, 5))
.DeleteFormatConditions (1)
.DeleteFormatConditions (2)
.DeleteFormatConditions (3)
End With
or
Worksheets(TargetWS).Range(Cells(5, 5), Cells(TargetRw, )).FormatConditions
(1).Delete

Does anyone know the syntax for using the Delete Method to delete
conditional formats (Format Conditions)?

Thanks