Pivot Table Problem

natetc

Board Regular
Joined
Oct 2, 2008
Messages
127
Hi,

I have a data that is run through a macro to create a pivot table.

In the pivot table I have variables in the daily data that I want to remove, however if the variables are not present in the daily data, then I receive this error:

Run-time error '1004':
Unable to get the PivotItems property of the PivotField class
--
.PivotItems("NOT READY").Visible = False

How do I formula this line to filter the variable if present.

Thanks in advance
 

Excel Facts

What does custom number format of ;;; mean?
Three semi-colons will hide the value in the cell. Although most people use white font instead.
Maybe like this

Code:
On Error Resume Next
.PivotItems("NOT READY").Visible = False
On Error GoTo 0
 
Upvote 0
Unfortunately that did not work, here is more of the formula:

.PivotItems("READY").Visible = False
On Error GoTo 0
.PivotItems("COMPLETED").Visible = False
On Error GoTo 0
.PivotItems("NOT READY").Visible = False
On Error GoTo 0
.PivotItems("IN PROGRESS").Visible = False
On Error GoTo 0
.PivotItems("(blank)").Visible = False

As you can see I inputed your sugestion with the 'On Error goto 0'
 
Upvote 0
Try like this

Code:
On Error Resume Next
.PivotItems("READY").Visible = False
.PivotItems("COMPLETED").Visible = False
.PivotItems("NOT READY").Visible = False
.PivotItems("IN PROGRESS").Visible = False
.PivotItems("(blank)").Visible = False
On Error GoTo 0
 
Upvote 0

Forum statistics

Threads
1,224,600
Messages
6,179,836
Members
452,947
Latest member
Gerry_F

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