PDA

View Full Version : [SOLVED] Getting Hyperlink Address



parscon
10-29-2013, 02:14 PM
I am trying to retrieve the address (file path) from a Hyperlink in a cell using VBA and i have this VBA code bit it is work just for A1 that mean first record.
I need to check all row of column A .
Please help me .

Thank you



Sub GetCellAddress()
cellAddress = Replace(Range("A1:A200").Hyperlinks(1).Address, "Hyperlink", "")
MsgBox cellAddress
Cells(1, 2) = cellAddress
End Sub

mancubus
10-29-2013, 03:11 PM
try this.



Sub ExtractHL_AdjacentCell()
'http://www.contextures.com/excelhyperlinkfunction.html


Dim HL As Hyperlink
For Each HL In ActiveSheet.Hyperlinks
HL.Range.Offset(0, 1).Value = HL.Address
Next
End Sub

parscon
10-30-2013, 12:37 AM
Thank you very much . Big help like always .

mancubus
10-30-2013, 02:08 AM
you are welcome.