Search notes:

Excel Object Model: Hyperlink

Methods and properties

Address
AddToFavorites()
Application
CreateNewDocument()
Creator
Delete()
EmailSubject
Follow()
Name
Parent
Range
ScreenTip
Shape
SubAddress
TextToDisplay
Type

Events

When a hyperlink is clicked, the worksheet.followHyperlink event is triggered.
This event has one parameter whose type is hyperlink and refers to the hyperlink being clicked.

Example

option explicit

sub main() ' {

    dim ws_1, ws_2, ws_3 as worksheet

    set ws_1 = activeSheet    : ws_1.name = "foo"
    set ws_2 = worksheets.add : ws_2.name = "bar"
    set ws_3 = worksheets.add : ws_3.name = "baz"

    dim target_cell_1, target_cell_2, target_cell_3 as range

    set target_cell_1 = ws_1.cells( 3,  2)
    set target_cell_2 = ws_2.cells(90, 60)
    set target_cell_3 = ws_3.cells(60, 90)

    ws_1.hyperlinks.add anchor := target_cell_1, address := "", subAddress := target_cell_2.parent.name & "!" & target_cell_2.address, screenTip := "goto Target 2", textToDisplay := "target 2"
    ws_2.hyperlinks.add anchor := target_cell_2, address := "", subAddress := target_cell_3.parent.name & "!" & target_cell_3.address, screenTip := "goto Target 3", textToDisplay := "target 3"
    ws_3.hyperlinks.add anchor := target_cell_3, address := "", subAddress := target_cell_1.parent.name & "!" & target_cell_1.address, screenTip := "goto Target 1", textToDisplay := "target 1"

    ws_1.activate


end sub ' }
Github repository about-MS-Office-object-model, path: /Excel/Hyperlink/basic.bas

See also

FollowHyperlink is the event that is triggered when a user clicks on a hyperlink.
The worksheet function =hyperlink(…).
Insert -> Links
Using the Hyperlink and Followed Hyperlink styles to specify the visual appearance of hyperlinks.
Excel Object Model, the Hyperlinks object.

Index

Fatal error: Uncaught PDOException: SQLSTATE[HY000]: General error: 8 attempt to write a readonly database in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php:78 Stack trace: #0 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(78): PDOStatement->execute(Array) #1 /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php(30): insert_webrequest_('/notes/Microsof...', 1758192218, '216.73.216.150', 'Mozilla/5.0 App...', NULL) #2 /home/httpd/vhosts/renenyffenegger.ch/httpsdocs/notes/Microsoft/Office/Excel/Object-Model/Hyperlink/index(110): insert_webrequest() #3 {main} thrown in /home/httpd/vhosts/renenyffenegger.ch/php/web-request-database.php on line 78