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
 

Some videos you may like

Excel Facts

Which Excel functions can ignore hidden rows?
The SUBTOTAL and AGGREGATE functions ignore hidden rows. AGGREGATE can also exclude error cells and more.

bl4met

New Member
Joined
Dec 15, 2011
Messages
19
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!
 

Watch MrExcel Video

Forum statistics

Threads
1,090,243
Messages
5,413,280
Members
403,472
Latest member
ArtisticOwl

This Week's Hot Topics

Top