ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   modification of hyperlink name (https://www.excelbanter.com/excel-programming/306622-modification-hyperlink-name.html)

@lan[_5_]

modification of hyperlink name
 
Hi,
could you tell me why the following code cause an execution error?

For Each h In Worksheets(nomfeuille).Hyperlinks
If InStr(h.Name, "test1") < 0 Then
h.Name = Replace(h.Name, "test1", "test2")
End If
Next

thank

--
Message posted from http://www.ExcelForum.com


Dick Kusleika[_3_]

modification of hyperlink name
 

I think the Name property is read only for hyperlinks, although I couldn't
confirm that in help. Try changing the Address property instead.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"@lan " wrote in message
...
Hi,
could you tell me why the following code cause an execution error?

For Each h In Worksheets(nomfeuille).Hyperlinks
If InStr(h.Name, "test1") < 0 Then
h.Name = Replace(h.Name, "test1", "test2")
End If
Next

thanks


---
Message posted from http://www.ExcelForum.com/




@lan[_6_]

modification of hyperlink name
 
It's ok with Address property
thank you!


Dick Kusleika wrote:
*I think the Name property is read only for hyperlinks, although
couldn't
confirm that in help. Try changing the Address property instead.

--
Dick Kusleika
MVP - Excel
Excel Blog - Daily Dose of Excel
www.dicks-blog.com

"@lan " wrote in message
...
Hi,
could you tell me why the following code cause an execution error?

For Each h In Worksheets(nomfeuille).Hyperlinks
If InStr(h.Name, "test1") < 0 Then
h.Name = Replace(h.Name, "test1", "test2")
End If
Next

thanks


---
Message posted from http://www.ExcelForum.com/


--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 11:29 AM.

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