using variable in value1 of PivotFilters.Add

A

aamerrasheed

Hi,

I am new to Macros and VBA. Trying to use a variable for value1 of
pivotfilters.add but it isn't working.
getting runtime error 1004.

Dim a As Variant
filtname = InputBox("Which data do you want", "Data input")

ActiveSheet.PivotTables("PivotTable1").PivotFields("Release cause"). _
PivotFilters.Add Type:=xlCaptionContains, Value1:=filtname


Thanks.
Aamer
 
A

aamerrasheed via OfficeKB.com

Hi,
Can anybody help me out in using variable in Value1 of PivotFilters.Add.

Thanks.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top