ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   reading hyperlinks (https://www.excelbanter.com/excel-programming/436017-reading-hyperlinks.html)

dstiefe

reading hyperlinks
 
I have a column of information and in each cell is a word...and the word is
also a hyperlink

in VBA how do i assign the URL of the hyperlink to a variable?

Thank you

Steve Yandl[_3_]

reading hyperlinks
 
This would show you the URL of the hyperlink in cell A1. You would want to
set this up to loop through all the cells in whichever column your links
are. If there is only one hyperlink in each cell, you can stick with the
"hyperlinks(1)" as I show in the example.

'------------------------------
Sub GetHyper()
Dim strURL As String
If Cells(1, 1).Hyperlinks.Count 0 Then
strURL = Cells(1, 1).Hyperlinks(1).Address
End If
MsgBox strURL
End Sub
'-----------------------------

Steve Yandl



"dstiefe" wrote in message
...
I have a column of information and in each cell is a word...and the word is
also a hyperlink

in VBA how do i assign the URL of the hyperlink to a variable?

Thank you




All times are GMT +1. The time now is 10:30 AM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com