Hi Here i have found macro code to extract URL from hyperlink(anchor tag) in MS Excel.
This code is very useful to fetch the particular URL from the hyperlink by single click. No need to view the website to view and copy the URL.

First in MS Excel go to Developer->Macros
give any name for macros and press enter key. Type the macro code here in the Visual basic code window which appear in it.

MACRO CODE:

Sub run()
On Error Resume Next
For Each hLink In Selection
Range(hLink.Address).Offset(0, 1) = hLink.Hyperlinks(1).Address
Next
End Sub

Save the Vb code file then goto excel sheet and select the hyperlink then go to the vb code and run the vb code and then view the excel sheet. It will automatically fetch the URL from the hyperlink..

i think this code will some what helpful for you

this code is useful for to retrieve the URL

This Post Is VEry Good

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.