VBA / Pivottable / showdetail - problem

S

sihvonma

Hi,

I have created VBA code to create a pivot table from data located in a
Excel sheet. The pivot table comes out beautifully. The problem is whe
the code attempts to modify the table.

I have 'months' selected as a column field. The problem is that I d
not want the separate month columns to be visible. Only the colum
totals.

This way the users can select which ever months they want to se
("cumulative" figures) in the column totals.

I can hide details for the month field manually. And it works just fin
after that. When I turned the macro recorder on when doing this manua
hiding the code created was (modified to show only the property):

...PivotTables("BudgetPivot").PivotFields("Month").PivotItems("Sep").ShowDetai
= False

When I inserted this code (actually a line for each month) to my pivo
table creation code and tested it what happened was that these line
had no effect at all. They did not cause any errors, nor they did th
task mentioned.

Can anyone help me in finding a way to hide the monthcolumns?

Thank you in advcance!

Marko =
 

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