![]() |
Listing of Pivot Table in a worksheet
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? |
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 --- |
Listing of Pivot Table in a worksheet
This worked great to list the pivot tables. Anything to show location of the
pivot table or the data range the pivot table is using? "Max" wrote: "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 --- |
Listing of Pivot Table in a worksheet
If nobody else jumps in here, suggest you try a new posting in .programming.
-- Max Singapore http://savefile.com/projects/236895 xdemechanik --- "ldc" wrote in message ... This worked great to list the pivot tables. Anything to show location of the pivot table or the data range the pivot table is using? |
All times are GMT +1. The time now is 09:23 AM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com