Calc Macro Delete Conditional Formating

Hello,

I’m trying since a full day, to use a macro to delete 1 specific Conditional Formating (CF) from 1 sheet that contrains several CFs. I even not able to delete or remove 1 CF. I tried several codes found on Internet : clear(), delete, remove, etc. Nothing works for me. I’m with Calc 26.2.5.2. Can someone help me ?

All this because I have some dynamical tables on my sheets. I use a CF to avoid “(empty)” writing them in White letter with White Background. When I update the Tables, the initial range of “A1:T10000” is splitted in multiple parts, and none of these parts is covering the dynamic tables afterwards. I know now this is a “normal” behavior. Therefore I try to have a workaround keeping the others CFs but deleting the CF with value “(empty)” and creating again.

Thanks a lot for your help. Thierry

Ask/Guide - How to use the Ask site - The Document Foundation Wiki #More_details

You should have attached an example file.

This is no useful information.

I made a very raw example for you. Don’t test it with your real document. Erroneos removal of CF items can’t be made undone.
disask_137267_RemoveCFbyUserCode.ods (31.6 KB)

A more valuable suggestion:
Don’t look for “macros” in such a case. but use
>Format>Conditional>Manage...
This tool was created by developers who knew the facts.

1 Like