making a hyperlink extractor macro

griffinwebnet

New Member
Joined
Aug 4, 2011
Messages
4
Ello All,

Ok, i have the extractor working, but what it currently does is extract the link and put it one cell to the right, but sometimes there is data in that cell that i dont want to replace. So i want to basically turn this (My current code):

Code:
Sub ExtractHL()
'Extracts the destination of all hyperlinks
Dim HL As Hyperlink

    For Each HL In ActiveSheet.Hyperlinks
    HL.Range.Offset(0, 1).Value = HL.Address
    Next

End Sub

Into this which prompts for a destination column:

Code:
Public Sub GetHyperlinksImg()

Dim Shp As Shape
Dim rngDestination As Range

Set rngDestination = Application.InputBox( _
Prompt:="Select any cell in the column " & _
"to receive the hyperlink names.", _
Title:="Destination Column", _
Default:=Selection.Address, _
Type:=8)

For Each Shp In ActiveSheet.Shapes
If Shp.Type = 13 Then
On Error Resume Next
Cells(Shp.TopLeftCell.Row, _
rngDestination.Column).Value = _
Shp.Hyperlink.Name
End If
Next Shp

End Sub

(By the way, i did not write the second one, which is why i cant seem to merge them. Im not entirely sure how it works.)

Thanks In Advance,

-JL
 

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Forum statistics

Threads
1,224,552
Messages
6,179,486
Members
452,917
Latest member
MrsMSalt

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top