Filter Pivot based on macro entry....

MSherfey

Registered User.
Local time
Today, 01:51
Joined
Mar 19, 2009
Messages
103
I have a pivot table I want to filter based upon the value supplied by the user. I tried to create a macro to do this, but keep getting a "1004" error which states 'application-defined or object-defined error'. When I look at the variable, it is holding the value, but it can't be used for some reason.


Code:
Sub Revenue_Filter()
Dim iRevenue As Integer
 
    iRevenue = InputBox(Prompt:="Revenue Value", Title:="User Response Requested")
    Sheets("SLE Totals").Select
    ActiveSheet.PivotTables("SLE Totals").PivotFields("Revenue").PivotFilters.Add _
        Type:=xlCaptionIsGreaterThanOrEqualTo, Value1:=iRevenue
    Sheets("SLEwZLM").Select
    Sheets("Adoption Rates").Select
End Sub


Any ideas?

Basically I have a totals sheet which is based on numerous pivot tables. I want an easy way for users to change the filter without having to go into each pivot.

If the macro idea isn't a good one, does anyone have a different idea?

I'm sorry to bump, but I've looked everywhere and can't seem to find an answer. I have noticed a few other people in other forums asking the same question without any luck either.

Thanks in advance for any help.
 

Users who are viewing this thread

Back
Top Bottom