Extract Multiple URLs from the hyperlink in Excel
When we are having whole series with hyperlinked URLs, from which we want to extract the corresponding underlying URLs.
This will help to extract actual addresses from multiple hyperlinks.
Extract URL one by one from Hyperlinks
Extract actual addresses from hyperlinks with Edit Hyperlink feature.
When you are having limited Hyperlinks in excel, then you can simple use Edit Hyperlink function. With this method, you can extract only one hyperlink address each time. You can extract the linked URL using Edit Hyperlink function.Right click on the cell of underlying text and click Edit Hyperlink as below.
1. Right click on the cell of underlying text and click Edit Hyperlink as below
2. Edit Hyperlink dialog box will be appeared. Select and copy (Ctrl+C) the entire URL from the Address field.
Extract actual addresses from set of hyperlinks with VBA code
Following VBA code method will help us when we want to work with lot of hyperlinks. We will get multiple addresses from the hyperlinks at once quickly.
3. Press ALT + F11 keys to open the Microsoft Visual Basic for Applications window.
4. Click Insert > Module, and paste the following code in the Module Window
Sub Extracthyperlinks()
'Updateby20140318
Dim Rng As Range
Dim WorkRng As Range
On Error Resume Next
xTitleId = "KutoolsforExcel"
Set WorkRng = Application.Selection
Set WorkRng = Application.InputBox("Range", xTitleId, WorkRng.Address, Type:=8)
For Each Rng In WorkRng
If Rng.Hyperlinks.Count > 0 Then
Rng.Value = Rng.Hyperlinks.Item(1).Address
End If
Next
End Sub
5. Then press F5 key to run the code, and a dialog pops out to select the hyperlinks that we want to extract the URLs.
6. Then click OK, and the selected cell contents have been converted to corresponding URLs.
Comments
Post a Comment