Hi,
Using Excel 2013 64-bit.
I have 2 Pivot Tables on a worksheet.
I'm curious why PivotTable2 is listed before PivotTable1?
Option Explicit
Sub GetPivotDetails()
Dim wb As Workbook
Dim ws As Worksheet
Dim pt As PivotTable
Dim r As Range
Dim r2 As Range
Dim r3 As Range
Dim i As Long
Dim sMessage As String
Set wb = ThisWorkbook
Set ws = wb.Worksheets("sPivot")
With ws
For Each pt In .PivotTables
Debug.Print pt.Name & " " & pt.TableRange1.Address
Next pt
End With
'Tidy up
Set ws = Nothing
Set wb = Nothing
End Sub
Output:
PivotTable2 $B$24:$O$38
PivotTable1 $B$5:$O$19
thx
w
Bookmarks