Hi, I have a bunch of cells with applied style through conditional formatting. My condition is if a certain cell is 0, cross over and gray out all the affected cells. It works, but changes all the number formating to stardard number. Every column has its own special number format wich makes it easier to read data inside. Can I leave those as is and still change the colors and font styles of the cells, or do I have to recreate conditinal formating for every column that has similar number format?
Unfortunately, no. Conditional formatting applies a cell style, and each cell style defines a complete set of formatting.
Ah, damn… thanks for letting me know, I was already pulling my hair off thinking there should be a simple solution…
(Original comment changed to an answer)
This is one of the very few cases where @mikekaganski isn’t exactly right.
ConditionalFormatting doesn’t apply styles to the concerned cells (by assigning the style to the cells), but only overlais its explicitly set attributes to the cell-areas in the view.
You will have created the “cross-out-style” with that “standard number format” explicitly. If the style to be overlaid conditionally is derived from default wihout touching the Numbers tab this shouldn’t happen. (Always tell your version. Sombody may know a bug …)
If you have a “tricky” CF applying a cell style using the STYLE() function during the evaluation of the condition, things are different. Hope you haven’t.
See example: ask298559CFdemo.ods
Ok, thanks, it is some kind of glitch. Copy pasting what I have into a newly created document works just fine. Just copying into a new sheet, or creating a new style does not work for that document. I must say that the document I have was saved out of MS Excel, so probably not 100% compatible even if it is ods. Problem solved nonetheless.
MS software has no reasonable concept of styles seemingly. I have no access for a long time now, and can’t test. Always save to the native ODF formats. MS surely will not worry much about improving their support for ODF. If a document has the bad fortune to once have been an MS victim, you may need to recreate some objects.
If the default style once got explicitly set a NumberFormat, the CF-styles derived from it will inherit that. You may try to get the default cell style back to virgin settings by using the Standard
buttons on the respective Tabs when modifying it.