I have the following code:
ActiveSheet.Range("$A$1:$P$201").AutoFilter Field:=5, Criteria1:="=10"*
When I click on the filter and type in the search bar 10*
I get all results that start with 10
. When using the macro, that doesn't work. The goal is for the macro to filter using the first two numbers provided by me.
Can you assist?
The core of the problem seems to have been trying to apply a text filter to a numeric field. Instead of:
just:
seems to have worked.
The following will work only if the values are text:
If the values are not text, then use a "helper" column.
EDIT#1:
For postal codes in column E, this will filter out (hide) rows not containing "10*" codes: