Tanyaann1995
Board Regular
- Joined
- Mar 24, 2021
- Messages
- 62
- Office Version
- 2016
- Platform
- Windows
Hi,
Currently, I am using the below code for filtering criteria with partial value only:
Is there a way to filter with multiple criteria but the criteria is just a partial value just like the above? I tried to edit the above code as given below but the data is not getting filtered with the partial value as criteria. The sheet shows blank cells because nothing is getting filtered.
Currently, I am using the below code for filtering criteria with partial value only:
VBA Code:
With Workbooks("Latest hist prices 4.xlsm").Worksheets(2)
.Range("A1:U79578").AutoFilter Field:=4, Criteria1:="=*" & cname & "*"
Is there a way to filter with multiple criteria but the criteria is just a partial value just like the above? I tried to edit the above code as given below but the data is not getting filtered with the partial value as criteria. The sheet shows blank cells because nothing is getting filtered.
VBA Code:
With Workbooks("Latest hist prices 4.xlsm").Worksheets(2)
.Range("A1:U79578").AutoFilter Field:=4, Criteria1:="=*" & cname1 & "*", Operator:=xlAND, Criteria2:="=*" & cname2 & "*"