Dynamic hyperlink that filters a table based on the ActiveCell value (VBA)
<p>I'm creating a dynamic hyperlink that will filter a table on another sheet (Sheet15). </p>

<p>My goal is to have the user be able to select a cell on Sheet3 and have the VALUE of this cell be the filter on the other sheet. </p>

<p>Here is my code so far:</p>

<pre><code>Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    If Target.Type = msoHyperlinkRange And Target.Range.Address = "$S$15" Then
        Application.ScreenUpdating = False
        Sheet15.Visible = True
        Sheet15.ListObjects("Table17").Range.AutoFilter Field:=19, Criteria1:=ActiveCell.Value
        Sheet15.Activate
        Application.ScreenUpdating = True
    End If
End Sub
</code></pre>

<p>However, when I click the hyperlink, the table is not filtered at all, so I gotta be doing something wrong. </p>

<p>Can anyone assist?</p>

<hr>

<p><strong>UPDATE</strong></p>

<p>Here is updated code. </p>

<p>Cell S17 is now the value that I want to filter the table to:</p>

<pre><code>Private Sub Worksheet_FollowHyperlink(ByVal Target As Hyperlink)
    If Target.Type = msoHyperlinkRange And Target.Range.Address = "$S$15" Then
        Application.ScreenUpdating = False
        Sheet15.Visible = True
        Sheet15.ListObjects("Table17").Range.AutoFilter Field:=19, Criteria1:=Sheet3.Range("S17").Value
        Sheet15.Activate
        Application.ScreenUpdating = True
    End If
End Sub
</code></pre>

<p>But the issue remains. When I click they hyperlink, I will be brought to this other sheet, but the table is not filtered at all. </p>