X

How To Extract URLs From Hyperlinks In Excel

If you need to save the URLs from hyperlinks. Will you click these hyperlinks one by one and save these URLs each time.

Today, Sandra will introduce a very easy and fast way to quickly make it, that’s VBA.

As shown in the picture above, the data in the cells of column A have been inserted with hyperlinks, and now we need to extract the URLs of the hyperlink to the cells of column B. Go to the developer and click on Macros and create.

You can just copy and paste the code in following.

Function GetAdrs(Rng)

Application.Volatile True

WithRng.Hyperlinks(1)
GetAdrs = IIf(.Address = “”, .SubAddress, .Address)
End With

End Function

Now, we back to the sheet and enter =getadrs(A1) in cell B1 and press enter key, then drop down to fill.

Ok, you have made it. Call it a day!

Categories: Excel Tips
Sandra: