PivotItems visible = false not working

Talha

New Member
Joined
Sep 18, 2018
Messages
5
Hi,
In a pivot table created through vba there is Pivotfield with dates (DD.MM.YYYY). I grouped them with months and years and showed all items.
Code:
[FONT=Times New Roman][SIZE=3][COLOR=#000000][/COLOR][/SIZE][/FONT]
[FONT=Arial][/FONT]
[FONT=Arial][SIZE=3][COLOR=#000000]Worksheets("Pivot_Tabellen").PivotTables(TableName).PivotFields("UTC Date").DataRange.Cells(1).Group Start:=True, End:=True, _
            Periods:=Array(False, False, False, False, True, False, True)

[FONT=Times New Roman][/FONT][/COLOR][/SIZE][/FONT][FONT=Arial][SIZE=3][COLOR=#000000]
Worksheets("Pivot_Tabellen").PivotTables(TableName).PivotFields("UTCDate").ShowAllItems = True
[/COLOR][/SIZE][/FONT]


[FONT=Arial]

[SIZE=3][COLOR=#000000][FONT=Times New Roman][/FONT]

Showing all items result in displaying start and End values of pivot field (like 01.01.2017). I want them to be not visible. I am trying to do it with following code

Code:
[FONT=Times New Roman][/FONT]
First_Item= Worksheets("Pivot_Tabellen").PivotTables(TableName).PivotFields("UTCDate").PivotItems(1).Name[FONT=Times New Roman]
[/FONT]
Worksheets("Pivot_Tabellen").PivotTables(TableName).PivotFields("UTC Date").PivotItems(First_Item).Visible= False

It is returning me an error that "Pivot items properties cant assigned to pivot field object". After grupping the pivot field for date. Excel automatically adds a pivot field year.

I will be really grateful for any suggestions/solutions.

Thanks
Best Regards





[/COLOR][/SIZE]

[/FONT]




 

Excel Facts

Enter current date or time
Ctrl+: enters current time. Ctrl+; enters current date. Use Ctrl+: Ctrl+; Enter for current date & time.

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top