Pivot Table

C

CD

Hi,

I have many pivot tables in a workbook and I need to
update them every month. In every pivot table there is a
field called month -in this field I have selected for
exampled "January". But next month I need to
add "February" to this field so that I will see January
and February and next month so on. (I can not leave them
all selected because if the month is not over the
information is not correct) I just find it is taking
forever to go to every one of these tables and make the
same selection to all these pivot tables. Can someone
please give me a sample of a code I can use. Or direct me
to the proper term for this so I can do a further search.

PS(Some times I have 2 to 3 pivot tables per sheet)

Thanks for reading this message.
CD
 
T

Tom Ogilvy

go to Debra Dalgleish's site

http://www.contextures.com/tiptech.html

go to the entry for

Pivot Tables - Show and Hide Items

under P.

I am sure that will get you started.


looping through sheets and tables

Dim sh as Worksheet
Dim pvtTable as PivotTable
for each sh in Thisworkbook.Worksheets
for each pvtTable in sh.PivotTables
msgbox pvtTable.Name
next
Next

the msgbox is a place holder. Using pvtTable as a reference to the current
pivotTable being addessed, you would add your code to adjust the visible
items here.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top