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.
- Copy vba code below
- Press Alt + F11
- Double click your sheet in project explorer
- Paste into code window
- 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