View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
Gord Dibben[_4_] Gord Dibben[_4_] is offline
external usenet poster
 
Posts: 9
Default Delete all Conditional Formatting Q

Iterate through the sheets.

Option Explicit
Sub DeleteConditionalFormats()
Dim ws As Worksheet
Dim r As Range, c As Range
On Error GoTo NoCellsFound
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.SpecialCells(xlCellTypeAllFormatCondition s).FormatConditions.Delete
Next ws
Exit Sub
NoCellsFound: MsgBox ("No Cells Found")
End Sub

Note: if any sheet has no CF you will get the error.


Gord Dibben MS Excel MVP


On Wed, 14 Jul 2010 07:25:52 -0700 (PDT), Seanie wrote:

Thanks Ron, 2007 is the version

How can I tweak to delete on all sheets in the active workbook?