Hi
I know it is possible to do: see the "test 2" (https://www.dropbox.com/s/ljfmphkp4uxu3is/test2.xlsm?dl=0) file. As you click on the pivot table cells, you get directed to the relevant tabs.
Have tried to achieve this in my file, but for some reason, the same trick does not appear to work - see "zero test 2" file (https://www.dropbox.com/s/zyp8e2g0sqygweb/zero test 2.xlsm?dl=0).
The vba code involved is as follows:
Please help.
Thanks
T
I know it is possible to do: see the "test 2" (https://www.dropbox.com/s/ljfmphkp4uxu3is/test2.xlsm?dl=0) file. As you click on the pivot table cells, you get directed to the relevant tabs.
Have tried to achieve this in my file, but for some reason, the same trick does not appear to work - see "zero test 2" file (https://www.dropbox.com/s/zyp8e2g0sqygweb/zero test 2.xlsm?dl=0).
The vba code involved is as follows:
Code:
Option Explicit
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
Dim pvtTable As PivotTable
Dim shtTemp As Worksheet
If Target.Cells.Count = 1 Then
For Each pvtTable In Target.Parent.PivotTables
If Not Intersect(pvtTable.RowRange, Target) Is Nothing Then
On Error Resume Next
Set shtTemp = Worksheets(Trim(Target.Value))
On Error GoTo 0
If Not shtTemp Is Nothing Then
Application.Goto shtTemp.Range("A1")
End If
End If
Next
End If
End Sub
Please help.
Thanks
T