Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

vba,locate pivot and thier names

Posted on 2013-11-06
3
Medium Priority
?
223 Views
Last Modified: 2013-11-06
Hello All,

i am Dealing with a complex workbook with one sheet where there are several pivots (I am getting confused)  – is there a vba to know how many pivots are there in a worksheet  and their names?
Thank you
0
Comment
Question by:Rayne
  • 2
3 Comments
 
LVL 31

Accepted Solution

by:
gowflow earned 2000 total points
ID: 39628022
sure. This code will print in the debug window name of all pivot tables in the current sheet.

Sub test()
Dim WS As Worksheet
Dim Piv As PivotTable

Set WS = ActiveSheet
For Each Piv In WS.PivotTables
    Debug.Print Piv.Name
Next Piv

End Sub

Open in new window


gowflow
0
 

Author Closing Comment

by:Rayne
ID: 39628100
Awesome GowFlow
Thank you
0
 
LVL 31

Expert Comment

by:gowflow
ID: 39628168
Your welcome
gowflow
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

After seeing numerous questions for Dynamic Data Validation I notice that most have used Visual Basic to solve the problem. This suggestion is purely formula based and can be used in multiple rows.
Microsoft has changed the look and feel of Azure AD and Microsoft account sign-in pages so that you will have a more unified look and feel when moving between the two interfaces.
This Micro Tutorial will demonstrate how to use a scrolling table in Microsoft Excel using the INDEX function.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

971 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question