Preserving conditional formatting results when pasting outside of libreoffice

I have a file formatted (Attached to this post, specifically I am interested just in columns A and B)
dlamari_carta_revisada5.ods (51.9 KB)
with conditional formatting rules. If I copy paste to the outside of Libreoffice (web, wordpress), format (background colors) are lost.
If I do manual formatting (just changing the background color of the cells), and then I copy paste and I do the same (copy pasting to the web), then the format is conserved into the web.
Is there a way I can copy the text with its conditional formatting?
Maybe I can convert conditional formatting into plain fixed formatting?


You can export as PDF without problem.
You can also do File > Export and choose file type XHTML


In the given case the pdf will know the colors set due to ConditionalFormatting, but, starting with row 35 also the nonsense zeros produced by a useless formula, and for the view of the sheet suppressed by a bad (dangerous) setting, not to show zero values.
Never disable >Tools>Options>LibreOffice Calc>View>>Display>>>Zero values !t’s evil.
Sheets designed following the “every other row” idea will always come with problems. In the given case a patch like using the formula =IF(C4="";"";C4) in row number 4, and filling it down then would help. Since your condition for BGWHITE compares to a string in place of the value, you wouldn’t get white cells then …

Merged cells also are evil.

BTW Concerning the “Never disable”: If you want to keep the simpler uncinditional formula, you can define a NumberFormat suppressing the special zeroes for the BGWHITE style. This way the cell won’t show a zero in the exported pdf.

The NumberFormat code would be General;-General;""

What is the “outside LibreOffice” you are talking of? (Pasting into a Writer document also wouldn’t set colors based on CF!)

See also: tdf#96597

1 Like

Try the following trick.
Select File / Save as or Save a copy …, File type: HTML Document (Calc). You will get a file with a .html extension, for example dlamari_carta_revisada5.html. Next, open a new file in Calc - the conditional formatting will be replaced with the real one! You can also open a new file directly in your browser.

1 Like

Thanks @Lupp !

I found both amusing and very pertinent your comments about evilness. You should make a guide of “how not to be evil using spreadsheets” or something like that. :grinning_face_with_smiling_eyes:

So, I followed your advice and exorcised the evilness from my spreadsheet (let it display zero values (I used your patch formula =IF(C4="";"";C4) ) and splitted cells back,), cleared all formatting and made new conditional formatting rules. And voila, everything works. I just copy paste into my Wordpress (with divi theme, that’s the “outside LibreOffice” I am talking about), and formatting is pasted OK (although not always, so I wonder what’s happening there, but it’s working most of the time, it could also be a divi/wordpress/firefox issue.
So, this was certainly not an obvious solution, so thanks a lot!!! and congrats for your expertise.
You can check the result here:

thanks @sokol92 !
this is a great workaround, but the main problem, as pointed out by @Lupp was the evilness within the spreadsheet, now that the spreadsheet is exorcised, everything works good again.

thanks @EarnestAl !
This could be a workaround, but @Lupp helped me clean up the spreadsheet and now it’s cleaned I don’t really need a workaround.

Check empanadas fritas. A wee little demon tries his bad there.

Glad to have helped.
Frustrated to not be able to visit your restaurant. No road to Santiago from München.


fixed the demon mischief.

It’s not exactly Santiago (Santiago has no coast) but, almost as near as you can be to Santiago while staying in the coast.