ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   cell address of hyperlink (https://www.excelbanter.com/excel-programming/401111-cell-address-hyperlink.html)

Rick S.

cell address of hyperlink
 
I have this code from one of you guru's (pretty sure it was Tom O.), but I do
not know how to get the cell.address of the hyperlink being tested.

'==========
Sub ChangeLink()
Dim hlink As Hyperlink
Dim s As String
Dim c As String

For Each hlink In ActiveSheet.Hyperlinks
s = hlink.Address 'is path of hyperlink doc.
If Left(s, 5) = "SPECS" Then
s = "=Hyperlink" & "(\\ENGINEERING\PRODUCTION\Qadocs\SPECS\)"
'add code to place new link in cell of hyperlink being tested
End If
Next
End Sub
'==========

All help is appreciated.

--
Regards

Rick
XP Pro
Office 2007


Ron de Bruin

cell address of hyperlink
 
Hi Rick


Try this

hlink.Parent.Address



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Rick S." wrote in message ...
I have this code from one of you guru's (pretty sure it was Tom O.), but I do
not know how to get the cell.address of the hyperlink being tested.

'==========
Sub ChangeLink()
Dim hlink As Hyperlink
Dim s As String
Dim c As String

For Each hlink In ActiveSheet.Hyperlinks
s = hlink.Address 'is path of hyperlink doc.
If Left(s, 5) = "SPECS" Then
s = "=Hyperlink" & "(\\ENGINEERING\PRODUCTION\Qadocs\SPECS\)"
'add code to place new link in cell of hyperlink being tested
End If
Next
End Sub
'==========

All help is appreciated.

--
Regards

Rick
XP Pro
Office 2007


Rick S.

cell address of hyperlink
 
Parent! I never listend to my parents! LOL

Thank you!

--
Regards

Rick
XP Pro
Office 2007



"Ron de Bruin" wrote:

Hi Rick


Try this

hlink.Parent.Address



--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm


"Rick S." wrote in message ...
I have this code from one of you guru's (pretty sure it was Tom O.), but I do
not know how to get the cell.address of the hyperlink being tested.

'==========
Sub ChangeLink()
Dim hlink As Hyperlink
Dim s As String
Dim c As String

For Each hlink In ActiveSheet.Hyperlinks
s = hlink.Address 'is path of hyperlink doc.
If Left(s, 5) = "SPECS" Then
s = "=Hyperlink" & "(\\ENGINEERING\PRODUCTION\Qadocs\SPECS\)"
'add code to place new link in cell of hyperlink being tested
End If
Next
End Sub
'==========

All help is appreciated.

--
Regards

Rick
XP Pro
Office 2007




All times are GMT +1. The time now is 09:19 PM.

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