Automatically recognize all URLs in Calc

According to manj_k’s answer to “How may I do Writer recognize hyperlinks automatically?,” this is possible in Writer (Tools → AutoCorrect → Apply), but Calc doesn’t appear to have that specific option.

How do I make Calc automatically recognize URLs in all selected cells?

Besides the proposed answer to convert someURL in text to the formula HYPERLINK("someURL"), the manual way I found to make Calc recognize a URL in text is to edit the cell in the formula bar, add a space on the end of the URL, delete it, and press [Enter] or click the ✓ to complete your change (that didn’t change anything). As soon as I add a space the URL turns blue-on-gray in the formula bar indicating Calc “spotted” the URL.

This trick doesn’t work if you’re editing in the default in-place [F2] Cell Edit Mode; Calc : How to edit formulae in formula bar directly explains how you can define a keyboard shortcut for the Calc Application function “Input Line”, or redefine the [F2] key from “Cell Edit Mode” to this.

Whether Calc will recognize URLs in text that you paste into it seems hit-or-miss in Linux. I think it depends on whether the incoming text is on the clipboard in a rich text format or HTML format.

I just spent half an hour looking for how to set up this and it was just “adding a space at the end”

:sweat_smile:

Thank you so much!

See here

(Almost eight years ago. And still work)

Thanks! I figured it might involve a search and replace. However, doesn’t that solution assume the cell only has a URL in it?

Neither in your question, nor in the sample to which you referred wasn’t a sample of the text like “Click the link https://ask.libreoffice.org/upfiles/avatars/JohnSUN/resized/128/JohnSUN_7.gif to go to the site”.

But even for such constructions, Search&Replace can build the right formula. Only the search string and the replacement string will be a little more complicated.