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(xlCellTypeAllFormatConditions).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.
What am I doing wrong on below which debugs with message "no cells
found", I tried to tweak to delete all CF in all sheets, without any
message box display
Sub DeleteConditionalFormats()
Dim ws As Worksheet
Dim r As Range, c As Range
On Error GoTo 0
For Each ws In ActiveWorkbook.Worksheets
ws.Cells.SpecialCells(xlCellTypeAllFormatConditions).FormatConditions.Delete
Next ws
Exit Sub
End Sub
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.