I want to make a filter in Excel with VBA that does the following:

1. In my pivottable, i have a couple of filters set, and i want to modify in VBA only the last filter. I select the drop_down selector:

a.JPG

2. I select all the items and then search there for a text, let's say 'sw':

b.JPG

3.After i wrote the text in the search box, i want to use the check box : "Add current selection to filter", and deselect '(Select all Search Results)':

c.JPG


This flow of actions work for my pivottable to show what i need.
The idea is that when an update is made in the sheet were the data is it would not reflect in this pivottable (i need this pivotfield to be filtered for a specific text that i search for)... I tried with refresh button but with no result. This is the only way that i managed to make the pivot table show what i need. But i need to do this very often, so i was wondering if i can write something in VBA to do those 3 actions described above.

I've tried different VBA codes that search with 'for each' but it search in all of that pivotfield items and i have almost 18000... it is very slow and crashes all the time.
I've tried recording the steps from above in a macro... but i get an error for that too.
Any idea would help.

Thank you !