VBA Exact Match Advanced Filter

Summerso1

New Member
Joined
Jul 24, 2014
Messages
45
Hi I have to code below that performs and advanced filter which finds the specific range however I need it to find an exact match also when it performs the filter.


for example now if finds the name PRODUCT01 but finds all products starting with PRODUCT01 so its finding e.g PRODUCT011, PRODUCT0113


How can I change this to only find exact matching strings?


Dim rngCrit As Range
Dim rngData As Range


Set rngData = Range("Main[#All]")


With Sheets("Input")
Set rngCrit = .Range("A1", .Range("A" & Rows.Count).End(xlUp))
End With


rngData.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=rngCrit, Unique:=True
 

Excel Facts

How to show all formulas in Excel?
Press Ctrl+` to show all formulas. Press it again to toggle back to numbers. The grave accent is often under the tilde on US keyboards.
In the Criteria Field instead of
PRODUCT01

enter
="=PRODUCT01"

that results in
=PRODUCT01

Hope this helps

M.
 
Upvote 0

Forum statistics

Threads
1,215,491
Messages
6,125,104
Members
449,205
Latest member
ralemanygarcia

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top