Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 3
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Pivot Table Filter Error sross002 Excel Discussion (Misc queries) 0 January 20th 10 03:26 PM
Automate Filter in Pivot table in VB Macro arun Excel Programming 0 September 5th 09 09:20 AM
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 Enda80 Excel Programming 0 May 3rd 08 01:03 AM
Filter a pivot table in a macro Jean-Marc P Excel Programming 3 October 3rd 07 10:03 PM
parameter and macro driven pivot table filter? Ryan Hartnett Excel Programming 0 October 25th 06 09:26 PM


All times are GMT +1. The time now is 06:19 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"