excelvbaadvanced-filter

Excel - Advanced Filter: Filter values greater than today


I'm trying to make use of Advanced Filter instead of AutoFilter as I'm told it performs much better in VBA. However, I can't seem to figure out a way to filter data to only show dates greater than today since that is dynamic and relies on a formula.

I've tried making my criteria range >today() and ">"&B2 where B2 is today()

Any idea what I'm missing?

Advanced Filter:

enter image description here

Data before:

before

Desired Result:

enter image description here


Solution

  • When using a formula in Advanced filter the formula itself is the filter. Remove the title from the criteria and point the formula at the first cell in the column data to be filtered. In this case:

    =A2>TODAY()
    

    So:

    enter image description here

    The Criteria must include the blank cell above:

    enter image description here

    And we get:

    enter image description here