ExcelBanter

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

[email protected]

adding hyperlinks
 
Hi,


I have code that inserts a hyperlink within a cell, then selects it,
but can I just insert the hyperlink within vba so the code just selects
the link,


my code at the moment is


Sheets("codes").Select
process = Range("b1")
Range("c1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="outlook://Public Folders/All Public Folders/BT
plc/Networks/Network Build/Processes/eTASK Enabled Processes/~" &
process & ".doc"


Range("c1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True


As you can see i insert the link into cell c1 then select it, its this
bit i want to remove, any help would be great, i have heard of the
followhyperlink method but i am unsure of the syntax to use


Johny


Jake Marx[_3_]

adding hyperlinks
 
Hi Johnny,

You can use ThisWorkbook.FollowHyperlink to do it without creating a
hyperlink in the Workbook:

ThisWorkbook.FollowHyperlink "outlook://Public Folders/" & _
"All Public Folders/BT plc/Networks/Network Build/" & _
"Processes/eTASK Enabled Processes/~" & process & ".doc", _
, False, True

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


wrote:
Hi,


I have code that inserts a hyperlink within a cell, then selects it,
but can I just insert the hyperlink within vba so the code just
selects the link,


my code at the moment is


Sheets("codes").Select
process = Range("b1")
Range("c1").Select
ActiveSheet.Hyperlinks.Add Anchor:=Selection,
Address:="outlook://Public Folders/All Public Folders/BT
plc/Networks/Network Build/Processes/eTASK Enabled Processes/~" &
process & ".doc"


Range("c1").Select
Selection.Hyperlinks(1).Follow NewWindow:=False, AddHistory:=True


As you can see i insert the link into cell c1 then select it, its this
bit i want to remove, any help would be great, i have heard of the
followhyperlink method but i am unsure of the syntax to use


Johny




All times are GMT +1. The time now is 05:13 PM.

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