Author: Oscar Cronquist Article last updated on February 25, 2018

Sean asks:

Basically, when I do a refresh of the data in the "pivotdata" worksheet, I need it to recognise the cell is a hyperlink. In addition, when I update the indivital pivot tables, it looks at the data in the "Notes" field and recognise it as a hyperlink.


Here is a simple pivottable, in sheet1.

Vba code

  1. Copy vba code below
  2. Press Alt + F11
  3. Double click your sheet in project explorer
  4. Paste into code window
  5. Return to Microsoft Excel
Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim ptc As PivotTable, Value As Variant, Rng As Range
If Target.Cells.Count = 1 Then
    For Each ptc In ActiveSheet.PivotTables
        If Not Intersect(Target, Range(ptc.TableRange1.Address)) Is Nothing Then
            If Left(Target.Value, 7) = "http://" Then
                ActiveWorkbook.FollowHyperlink Address:=Target.Value, NewWindow:=True
            End If
        End If
    Next ptc
End If

End Sub

Now try clicking a cell containing a hyperlink  in the pivot table!

Download excel 2007 workbook *.xlsm

Hyperlinks in pivot tables.xlsm