How make URLs in cells clickable?

I have a table with a list of URLs — one URL per cell.
This URL’s looks like text - they are not hyperactive.

If I edit one cell - just put cursor at the end of URL and push “enter”, then this URL becomes active hyperlink. Now this URL blue, underlined and I can Ctrl-click on it to open this URL.

Question is - How can I make all my URLs be active links?

The quickest way to get active URLS for a list of URLs in column A starting at A2 is to enter into cell B2 =HYPERLINK(A2) and copy down. Column B will then contain clickable links.

1 Like

If you are up to a macro, then the following will convert each cell in the current selection into a hyperlink with the same URL as the cell text itself.

  1. This code automatically adds https:// to a URL if that is missing. If you don’t want that, simply remove that If clause.
  2. It also sets each hyperlink cell style to the constant style name given in the macro. If you create a style just for hyperlinks then you can change that constant to your new style name. If you want no styling, just remove that line.
Sub Hyperize()
	Dim Selection As Object
	Dim URL As String
	Dim Row As Integer
	Dim Column As Integer
	Dim Style As String
	Style = "Accent" 'Change to, say, "Hyperlink" if you create a specific style for that
	Selection = ThisComponent.getCurrentSelection()
	If Selection.ImplementationName = "ScCellObj" Then
		HyperizeCell(Selection, Style)
	ElseIf Selection.ImplementationName = "ScCellRangeObj" Then
		For Row = 0 To Selection.Rows.Count - 1
			For Column = 0 To Selection.Columns.Count - 1
				HyperizeCell(Selection.getCellByPosition(Column,Row), Style)
			Next Column
		Next Row

End Sub
Private Sub HyperizeCell(Cell As Object, Style As String)
	Dim URL As String
	URL = Cell.Text.String
	If LCase(Left(URL,8)) <> "https://" Then
		URL = "https://" & URL
	Cell.Text.Hyperlink = URL
	Cell.CellStyle = Style 'Remove if no styling wanted
End Sub