Displaying items within pivot table fields

G

Gerald

Hi

Within a macro I've written I have the following syntax (which is not
working); at the time that the macro reaches this line of code only
the "ACCDNT" item in the "complaints_code" field within the
"ComplaintsTable" pivot table is being displayed:

With ActiveSheet.PivotTables("ComplaintsTable").PivotFields("complaint_code")
.PivotItems("ACCDNT").Visible = False
.PivotItems("ADVERSE").Visible = True
End With

Basically all I want to do is have the macro display the "ADVERSE"
item instead of the "ACCDNT" item, but it doesn't seem to want to work
the way I have it written. Any help very much appreciated

Thanks in advance
Gerald
 
T

Tom Ogilvy

try reversing the order - one item must always be visible

With
ActiveSheet.PivotTables("ComplaintsTable").PivotFields("complaint_code")
.PivotItems("ADVERSE").Visible = True
.PivotItems("ACCDNT").Visible = False
End With
 

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

Similar Threads


Top