Bram van der Plas
Bram van der Plas

Reputation: 79

How to use vba to filer a column using value from a specific cell

I want to use a macro to filter columns in a table. I want to filter for values that are higher than a value I want to put in cell, to be able to easily change the filter. Does someone have a trick for doing this with vba? Many thanks, Bram

Upvotes: 1

Views: 36

Answers (2)

Bram van der Plas
Bram van der Plas

Reputation: 79

Thank you for you answer. I tried this already, but I could not get the macro to pick from a specific cell. If I stored the value of the specific cell under as 'value' and put that in the outlined code, it would just do Greater Than value.. DO you have shortcut for this? Thanks!

Upvotes: 0

QHarr
QHarr

Reputation: 84465

Record a macro whilst filtering a table on a column value. You would right click on the table column header of interest whilst recording the code and select Number_Filters > Greater Than and enter your desired number. That would give you the outline code. You can then amend the code to pick up the desired value from a specified cell. If applying filter to multiple columns record macro whilst doing this process over several columns.

Upvotes: 1

Related Questions