Change background fill of cells in LibreOffice worksheet containing specific text

-1

1

How can I change the background fill of all the cells of a LibreOffice spreadsheet worksheet that contain a specified text?

In Excel that could be done by configuring the settings in the find and replace dialog.

eremelis

Posted 2014-02-13T08:05:43.003

Reputation: 19

Do you mean you want to know how to change the colour of the background of the cells dependant on the contents as in "conditional formatting"? – Tog – 2014-02-14T07:57:24.277

Answers

0

AFAIK, in LibreOffice / OpenOffice Calc, you can't use the find/replace functionality to replace the style of a cell that contains a certain text. But you could achieve the same result by using conditional formatting:

To apply a style conditionally depending on the the content of a cell range, just do the following:

  1. Select the range of cells;
  2. Open Menu "Format" -> "Conditional Formatting..."
  3. In the following dialogue, select "Formula is" from the first ComboBox;
  4. Enter the following formula into the text field:

    SEARCH("searchtext"; A1)

    (assuming the first cell of the cell range [Step 1] is A1, and you want to highlight cells containing "searchtext")

That's it. The following screenscot shows the solution applying a custom style to all cells containing the string "ue" in the cell range A1:A22:

Conditional formatting

Take care about the cell reference in the formula. It should b relative to the first selected cell (in my example: A1). LibreOffice adapts the cell reference for all other cells in the selected range.

tohuwawohu

Posted 2014-02-13T08:05:43.003

Reputation: 8 627

1Thank you. Can you add this answer to FAQ of Libre/OpenOffice or send to its developers? – eremelis – 2014-02-13T18:45:13.093