VBA GetPivotData error handling

bl4met

New Member
Joined
Dec 15, 2011
Messages
19
I have code that pulls data from a pivot table and places it another table. It will work fine until it tries to do a look up in the pivot table for a value that isn't listed in the pivot table. The Pivot table is based on pulls from our ticketing system so it might not have tickets from all the regions but the table I'm pulling the data for lists all the regions. If I was getting a #NA or a #REF I would just check for it and change it to 0 but I'm getting a Run Time Error 1004.

Code:
ActiveCell = (ptSysTotal.GetPivotData("Duration by Time and Impact", "System", ActiveCell.Offset(0, -1).Value & " "))

Any help would be nice
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).
Thanks, cant believe I didn't think of that. I'm always bad a writing error trapping into my code, especially when I'm the one running it. I really need to get better at that. Thanks again!
 
Upvote 0

Forum statistics

Threads
1,214,911
Messages
6,122,195
Members
449,072
Latest member
DW Draft

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