VBA: how do I change PivotItems(i).Visible tot True?

  • Thread starter Thread starter TS
  • Start date Start date
T

TS

Hi there,
When I record a macro the code looks like this:

With ActiveSheet.PivotTables("PivotTable1").PivotFields("Year")
.PivotItems("2004").Visible = True
End With

Then I try to run the macro, but all I get is a "Runtime Error 1004: Unable
to set the Visible Property of the PivotItem class"

Hiding the PivotItem is no problem: just change True in false and the macro
runs fine.
Experts, what's wrong with the code?
I'm using Excel2000-Sr1.
 

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

Back
Top