Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
pivot table filter macro error
Hi All,
I am having some issues with a piece of code. every time we try to run this macro, the program bugs up in the ElseIf statement. The error code is: Run-time Error '5': Invalid procedure call or argument. If someone wouldn't mind just reading over the code to see if there are any issues, it would be greatly appreciated! Here is the code: 'Filter Pivots For Each pt In ActiveSheet.PivotTables For x = 1 To pt.PageFields.Count If pt.PageFields(x) = trainingPageField Then pt.PageFields(x).CurrentPage = filter ElseIf pt.PageFields(x) = countPageField Then *****ERROR @ NEXT LINE***** -- pt.PageFields(x).CurrentPage = filter <-- If ActiveSheet.Name = sickLeaveSheet Then Call FilterRegion End If End If Next x Next pt Hopefully someone will be able to spot the issue. Please feel free to ask for any clarifications. Thank you in advanced -Josh |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Pivot Table Filter Error | Excel Discussion (Misc queries) | |||
Automate Filter in Pivot table in VB Macro | Excel Programming | |||
I tried to get around the problem of the pivot table field settingdefaulting to Count instead of Sum by running a macro of change the settingfrom Count to Sum. However, when I tried to run the Macro, I got error messageof run time error 1004, unable | Excel Programming | |||
Filter a pivot table in a macro | Excel Programming | |||
parameter and macro driven pivot table filter? | Excel Programming |