ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Pivot Table Selecting Items (https://www.excelbanter.com/excel-programming/328575-pivot-table-selecting-items.html)

AK

Pivot Table Selecting Items
 
Is there a way to select certain Pivot items based on a data source that
changes frequently?

If all the items were included it would be 5 items, "A - E"
I only want to show A, B, and C. I'm familar with the ....Visible=True
statement, however what if B doesn't exist in the data source for this week,
however it was last week.

......PivotItems("A").Visible = True

Thanks in advance

Debra Dalgleish

Pivot Table Selecting Items
 
You could use something like this:

On Error Resume Next
.PivotItems("A").Visible = True
.PivotItems("B").Visible = True
.PivotItems("C").Visible = True
On Error GoTo 0


AK wrote:
Is there a way to select certain Pivot items based on a data source that
changes frequently?

If all the items were included it would be 5 items, "A - E"
I only want to show A, B, and C. I'm familar with the ....Visible=True
statement, however what if B doesn't exist in the data source for this week,
however it was last week.

.....PivotItems("A").Visible = True

Thanks in advance



--
Debra Dalgleish
Excel FAQ, Tips & Book List
http://www.contextures.com/tiptech.html



All times are GMT +1. The time now is 10:15 AM.

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