Calc Find & Replace resets text colour in cell to Black

Hello Everyone,

I have noticed that any time I perform a Find & Replace in Calc, if there is a value that was replaced in the cell, it turns all of the texts to black.

Is there any way to avoid this happening, so that the texts in the cells keep their original colours ?

Thanks!

EDIT:

Thanks, in answer to 1:

File attached illustrating problem. Screenshot showing settings in Find/Replace.

LO v24.8.2.1 (AARCH64)
MacOS Sonoma 14.7

In answer to 2 / 3:

I am only looking to find/replace certain words or text phrases in the Cells where some of the words have a colour (red, green, blue etc). When I perform the find/replace, all of the texts that have a colour are turned black.

test.ods (11.3 KB)

  1. Please edit your question and provide as attachment an example document showing the issue for you and containing a very exacpt description about how (with what settings) you ordered the F&R. You may insert an image of the dialog window into this document.
    Also mention your LibO version and your OS.
  2. Do you know the difference between the terms “text” and “string” as used in Calc.

is very unclear (for me) regarding the short title of the question.

Thanks, I edited my original post with the answers to your questions.

Your example doesn’t actually show how the cell you are talking of looked before the F&R nor do the Find: and the Replace: lines contain examples.
Pasting an image into the editing windowlet here is a clever way to provide little information in a huge area. :wink:
Anyway I now think, your problem is to understand that replacing (even if only a part of the original string is targetted) always creates a new string which is inserted into the respective cell. This string will always be formatted completely following the settings for the cell.
What you seem to expect can’t be done with F&R. To get that behaviour for a kind of “custom F&R” would require a lot of custom code.

2 Likes

That happens because on Replace the resulting entire cell text is entered anew as if typed on keyboard, which discards inline (in-cell) text attributes.

Maybe you can edit the subfile content.xml, and find and replace there.

Thanks for your replies.