LibreCalc fails to copy formula of multiple cells to the clipboard; uses displayed value instead

I did Ctrl + ~, I.e.: press and hold the control key, and then pressed the tilde key located below the Esc key.

This displayed the ‘formulas’ of all the cells, as desired, instead of the calculation. I selected and copied all the desired cells, and then pasted it into a separate text file. It shows the displayed value not the formula.

How may I resolve this?

You could save as csv and select option to Edit Filter settings then in the edit dialogue select Save cell formulae instead of calculated values. Close the csv and open in chosen editor

You can fill a nearby range, or in the next sheet, with the formula =FORMULA(cell_reference), and copy from there.

4 Likes

For a not too large range that’s even better…

1 Like

If the range contains cells with and without formulas, then the answer from @LeroyG can be modified:

=IF(ISFORMULA(A1);FORMULA(A1);IF(ISBLANK(A1);"";A1))
4 Likes

Select/mark the cell range to copy, invoke Find&Replace (Ctrl+H)

  • Find: ^.
  • Replace: '$0
    • Other options:
    • ✓ Current selection only
    • ✓ Regular expressions

Hit ReplaceAll. Close Search Results dialog. Close Find and Replace dialog.
Ctrl+C to copy to clipboard. Ctrl+Z to undo replacement.
Paste elsewhere.

Note that the replacement string '$0 is Apostrophe (single quote) Dollar Zero, which prepends the found cell content formula string with a single quote to re-enter it as text content.

I got the output ‘search key not found’. Search for ‘^.’ , replace with ‘’$0’

This is what most of the formulas on the sheet look like, basically

=$202201_16_Car.O6 =$202201_16_Car.P6
=$202201_16_Car.O13 =$202201_16_Car.P13