ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   VBA / Pivottable / showdetail - problem (https://www.excelbanter.com/excel-programming/316931-vba-pivottable-showdetail-problem.html)

sihvonma

VBA / Pivottable / showdetail - problem
 

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 =

--
sihvonm
-----------------------------------------------------------------------
sihvonma's Profile: http://www.excelforum.com/member.php...fo&userid=1651
View this thread: http://www.excelforum.com/showthread.php?threadid=31367



All times are GMT +1. The time now is 03:47 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com