Query Criteria Help

pkarnowski

New Member
Joined
May 12, 2004
Messages
15
I want to put a criteria condition that will ask you to type in lets say 4 letters so it pulles the data that has that word in it. I know I can use
LIKE"*fish*" to get everything with the word fish in it but I want to be able to type the 4 letters in to find it. I have tried ???? but only get the ones that have exactly "fish" in it but I need the ones that also say "fish and chips"
 

Excel Facts

Highlight Duplicates
Home, Conditional Formatting, Highlight Cells, Duplicate records, OK to add pink formatting to any duplicates in selected range.
I found one way to do it and that was to have the person looking for the data put a * before and after. I put the instructions in [ ] when the box pops up.
Thanks
 
Upvote 0
So that you don't have to rely on the user to enter the wildcards, you could put this in the criteria:

Like CStr("*" & [PartOfSearchWord] & "*")

TD
 
Upvote 0

Forum statistics

Threads
1,221,834
Messages
6,162,268
Members
451,758
Latest member
lmcquade91

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