Macro to Remove Conditional Formatting from Sheet

Anonymous
2024-05-16T23:31:02+00:00

I have a workbook that has too many sheets that have conditional formatting, and it crashes on a regular basis. When recovering the workbook, there is a note that the problem was the conditional formatting, so I want to remove it from the entire workbook. There are not built in functions to do this, so I wanted to create a macro, but the macro recorder doesn't record the steps to remove conditional formatting from an entire sheet. What code would be needed to do this within a looping macro? I have other looping macros that work by selecting the sheets, and they go sheet by sheet running the code through the selection, so I was hoping to just add the code to one of them. I have several versions of Excel, but the most current is Excel 2021 on Windows 11.

Microsoft 365 and Office | Excel | For business | Windows

Locked Question. This question was migrated from the Microsoft Support Community. You can vote on whether it's helpful, but you can't add comments or replies or follow the question.

0 comments No comments
{count} votes
Answer accepted by question author
  1. Anonymous
    2024-05-17T18:38:12+00:00

    Here is my recorded macro. It works at my side.

    Sub Macro1()

    ' Macro1 Macro

    Cells.FormatConditions.Delete 
    

    End Sub

    Could you share a test file to reproduce your issue?

    You may upload file in private message.

    Private Messages - Microsoft Community

    1 person found this answer helpful.
    0 comments No comments

4 additional answers

Sort by: Most helpful
  1. Anonymous
    2024-05-17T01:40:41+00:00

    You can use clear ruls for selected cells.

    1 person found this answer helpful.
    0 comments No comments
  2. Anonymous
    2024-05-17T12:27:40+00:00

    That is what I am trying to do in a macro. I tried the macro recorder, and it didn't record the steps.

    0 comments No comments
  3. Anonymous
    2024-05-17T20:37:19+00:00

    Thank you. I will try that. I don't know why the recorder wouldn't record that portion. It recorded all of the other steps I took during the recording.

    0 comments No comments
  4. Anonymous
    2024-05-17T20:44:48+00:00

    That worked. Thank you!

    0 comments No comments