View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.misc
Max Max is offline
external usenet poster
 
Posts: 9,221
Default Listing of Pivot Table in a worksheet

"ldc" wrote:
Is there a function similar to "Insert-Name-Paste-Paste List" for pivot
tables, where I can generate a list of all pivot tables and where they are
located in the spreadsheet?


A google search revealed a sub by Charles Chickering, pasted below:
-------------------
Sub ListPivotTables()
Dim PT As PivotTable
Dim Sh As Worksheet
Dim lSh As Worksheet 'Loop Sheet
Set Sh = Worksheets.Add
Sh.Range("A1") = "Pivot Table Name"
For Each lSh In ActiveWorkbook.Worksheets
For Each PT In lSh.PivotTables
Sh.Range("A" & Sh.Rows.Count).End(xlUp).Offset(1) = PT.Name
Next
Next
End Sub
--
Charles Chickering
"A good example is twice the value of good advice."
"nj" wrote:
I've for a TOC for the sheet and can use "Paste List" to get a list of
named ranges, but can someone point me towards the code for generating
a list of the pivot tables in a file?

I'm needing to go thru the file clean up the naming conventions and
then update the subroutines to use the updated names.

Something comparable to ActiveWorkbook.Sheets.Count, I guess?

-----------
--
Max
Singapore
http://savefile.com/projects/236895
xdemechanik
---