List PivotTables
Sub ListPivots()
Dim myPivot As PivotTable
Dim myCounter As Long
myCounter = 1
For Each myPivot In ActiveSheet.PivotTables
Cells(myCounter, 1).Value = myPivot.Name
myCounter = myCounter + 1
Next
End Sub
This puts the first pivot name into A1, next in A2 and so on so you may want
to adjust the code to avoid overtyping existing data!
"Greg Tan" wrote:
I am working with a spreadsheet that contains 15 pivot tables, and I am
writing a macro to update them programatically. Is there a way to list ALL
the pivot tables in a sheet without actually going to them and
right-clicking, going to Table Options and seeing the name there? TIA
--
Greg Tan
|