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

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.

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,103
Messages
5,412,444
Members
403,427
Latest member
mese0115

This Week's Hot Topics

Top