VBA macro to turn text URLs to clickable links in excel spreadsheet.
This macro
- Checks whether cell has text URL or not
- If the cell contains text URL, then it turns it into clickable URL
- Moves to cell in the next row
- Repeats the steps from 1 to 3 until it reaches an empty cell
VBA code to convert text URLs to clickable links
Sub textUrlsToclickableURLs() Do ' Checks if it is a text URL If InStr(ActiveCell.Value, "http://") Or InStr(ActiveCell.Value, "https://") Then ' Turning the text URL into clickable URL ActiveSheet.Hyperlinks.Add Anchor:=Selection, Address:=ActiveCell.Value, _ TextToDisplay:=ActiveCell.Value End If ' Move to text URL in next row ActiveCell.Offset(1, 0).Select Loop Until ActiveCell.Value = "" End Sub