我有代码来扫描文档并使用超链接打印数据透视表的所有名称。但不确定如何将其链接到数据透视表的位置。这是代码:
Sub Button20_Click()
Dim sh As Worksheet
Dim cell As Range
Dim pvt As PivotTable
Range("A1").Select
For Each sh In ActiveWorkbook.Worksheets
For Each pvt In sh.PivotTables
ActiveCell.Hyperlinks.Add Anchor:=Selection, Address:="", SubAddress:= _
"'" & pvt.Name & "'", TextToDisplay:=pvt.Name
ActiveCell.Offset(1, 0).Select
Next pvt
Next sh
End Sub