Skip to main content

Worksheet.FollowHyperlink event

Table of contents
  1. Syntax
  2. Parameters
  3. Example

Occurs when you choose any hyperlink on a worksheet. For application- and workbook-level events, see the Application.SheetFollowHyperlink event and Workbook.SheetFollowHyperlink event.

Syntax

expression.FollowHyperlink (Target)

expression An expression that returns a Worksheet object.

Parameters

Name Required/Optional Data type Description
Target Required Hyperlink Hyperlink object that represents the destination of the hyperlink.

Example

This example keeps a list, or history, of all the links that have been visited from the active worksheet.

Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink) 
    With UserForm1 
        .ListBox1.AddItem Target.Address 
        .Show 
    End With 
End Sub

Leave a comment

Your email address will not be published. Required fields are marked *

Format your code: <pre><code class="language-vba">place your code here</code></pre>