Delete 'conditional formatting' across many sheets at once?

Having to go to Format > Condition > Manage on each individual sheet is time consuming.
The reason I’m doing this, is for some reason the Column and Letter show up as #ref.
[strikethrough]I tried to copy the format from a good sheet, and did Ctrl + Shift + V, and the #ref still appears.[/strikethrough]

Right clicking on a cell and doing clear direct formatting is not an option neither, since this removes the display formatting. E.g. 10:42 is shown as 1042. 00\:00.000 is used so I don’t have to manually enter :.

Edit: I was able to copy the format from the good sheet, by manually selecting the cell range a 2nd time; first time is when I used Ctrl C shortly after.

in case you use this for »time-input« … NO, NO, NO… its still »one-thousand-fourty-two« and not »ten minutes and fourty-two seconds«

1 Like

I meant to say 1042 is shown as 10:42 after pressing enter key.
I use the function TEXT(TEXT(A1,"00\:00\:00.000"),"hh:mm:ss.000")), if I need to to do arithmetic. Still beats entering :.

Thats complete nonsense, and returns »error 501«

What do you want/expect if you enter 1063 ?
What in case of 2517 ?

If you would work with cell styles, Ctrl+M would remove conditional formatting from any (multiple) selection of cell range(s).

The cell where I’m doing the arithmetic on, is formatted as MM:SS.000;@.
Arithmetic in this case is simply duration, time from column A subtracted from column B.

#VALUE! is shown, which is good enough for me.

python:

def remove_all_Conditional_Format(*_):
    doc = XSCRIPTCONTEXT.getDocument()
    for sheet in doc.Sheets:
        _formats = sheet.ConditionalFormats
        for cf in _formats.ConditionalFormats:
            _formats.removeByID(cf.ID)
1 Like

I thought LibreCalc used BASIC, if they’ve implemented Python I’ll look into this.
I’m familiar with OpenPyXL.

… and also interfaces for python, beanshell and javascript!

basic:

sub remove_all_Conditional_Format 
    doc = thisComponent
    for each sheet in doc.Sheets
        _formats = sheet.ConditionalFormats
        for each cf in _formats.ConditionalFormats
            _formats.removeByID(cf.ID)
        next cf
    next sheet
end sub
1 Like

The question was (IMO) based on the fundamental misunderstanding that the interpretation of a four-digit-integer as a time or TimeOfDay value is a matter of formatting.
It isn’t. Calculations are required, and the resulting value shown in a time format is completely different from what was entered.
What I call re-interpretation is surely not wanted to apply to all cells of one or more sheets. The decision if it shall take place can be based on a cell style (its name actually), and this style can also do the still needed formatting.
To make that work the sheet event “Content changed” must be bound to a proper routine .
See attached example:
disask_128836_FunnyTimeInput.ods (19.3 KB)
I made this just for fun. Any user who has less than 5000 time values per day to enter won’t get an advantage.
Wasted time again.

1 Like