Set Pivot-Table Visible Items

M

Mike H.

With ActiveSheet.PivotTables("AssetPT").PivotFields("Cost ctr")
.PivotItems("12476").Visible = True
.PivotItems(DataArray(X, 1)).Visible = True
end with

Why would the line with "12476" work and the line immediately below, where
DataARray(x,1) equals "12476" give me this error:

Error (1004) Unable to get teh pivotItems property of the pivotfield
class?????
 
D

Debra Dalgleish

Manually or programmatically set the field to Manual sort, to prevent
that error:

With ActiveSheet.PivotTables("AssetPT").PivotFields("Cost ctr")
.AutoSort xlManual, .SourceName
 

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

Top