I want to pass a variable into a value filter for a pivot table.
The code gives me errors.
I'm trying to put the x variable into Value1.
Sub Macro1()
'' Macro1 Macro
'
x = "*" + Range("Sheet1!h17").Value + "*"
ActiveSheet.PivotTables("PivotTable2").PivoJtFields("Note").ClearAllFilters
ActiveSheet.PivotTables("PivotTable2").PivotFields("Note").PivotFilters.Add _
Type:=xlCaptionContains, Value1:=x
End Sub