Forum Discussion
How can I extract URL from hyperlinks?
Without using macros, you can follow below steps.
1. Right-click a hyperlink. You'll see a Context menu appear.
2. From the Context menu, choose Edit Hyperlink. Excel displays the Edit Hyperlink dialog box
3. Select and copy the entire URL from the Address field of the dialog box.
4. Press Escape to close the Edit Hyperlink dialog box.
5. Paste the URL into any cell desired.
With Macro
Sub ExtractHL()
Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub
Function GetURL(rng As Range) As String
On Error Resume Next
GetURL = rng.Hyperlinks(1).Address
End Function
=GetURL(A1)
Hopefully you will get it solved, Follow to learn more https://towntasks.com
TownTasks the hyperlinks are not clickable unless I click twice on the cell. Could you give any hint or trick to fix this thing, please!
P.S: I tried both macro and GetURL function.