Home |
Search |
Today's Posts |
#1
|
|||
|
|||
VB Corrupting Pivot Tables
Hi,
I have found that using the following code I am able to corrupt the data in my pivot table: On Error Resume Next ActiveSheet.PivotTables("PTMonthlyAnalystSalesPA") .PivotFields("PA").CurrentPage = ActiveSheet.Range("B1").Value If Err Then ActiveSheet.PivotTables("PTMonthlyAnalystSalesPA") .PivotFields("PA").CurrentPage = "(blank)" What I have found is that values in the PA page field are changed, even though the actual data source has not. For example, my list used to contain the name "Alex", but this is replaced with "Steve". In the data source "Steve" is not referenced in the SA column. If I select Steve, it pulls the data for Alex! If you refresh this doesn't make a difference. If you replace the pivot table with an identical table it returns to normal, until I start running this code again. Has anyone encountered this problem and can advise how I can avoid this? Thanks, Ra |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
overlapping pivot tables | Excel Discussion (Misc queries) | |||
Blank Cells in Pivot Tables | Excel Discussion (Misc queries) | |||
Macro for Pivot Tables | Excel Discussion (Misc queries) | |||
Product Function in Pivot Tables from Multiple Consolidation Range | Excel Worksheet Functions | |||
How does the term 'pivot' apply to Excel's Pivot tables and Pivot. | Excel Discussion (Misc queries) |