Forum Discussion
Malcolm McMaster
Jun 07, 2017Copper Contributor
VBA Macro to write to Pivot table "Search" filter
Hi everyone,
I have a requirement for a code to copy data from a cell in a workbook & paste the value into the search field of a pivot table.
Just to illustrate, I want to copy the data from worksheet 1 (Cell A1) and then paste this vaue into a pivot table search filter field so that the pivot table will then generate the report based on the new data supplied by the code.
Any help (as always) would be much appreciated.
- Zachary GrotovskyBrass ContributorYou may want to try recording a macro. During recording, do that action that you need done, then stop the recording. Take a look at the code that was generated and adjust it accordingly to meet your needs.
Better to take some sample and adjust it to own needs, google returns quite many, e.g. https://www.mrexcel.com/forum/excel-questions/734700-update-pivot-table-filter-based-value-another-cell.html
I'm myself never did such filtering and can't give concrete advice