USING AUTOFILTER TO FIND A TEXT VALUE WITHIN A CELL...

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
670
I simply want to use vba's autofilter to find all values in column G(7) in a cell containing several lines of wrapped text The value can be (1) the first word, (2) in the middle of the text, (3) or the last word. in the text

This is all I'm looking for. As you can see, the result brown, is in the middle of the text if the autofilter criteria works correctly. But as mentioned, correct code should also pull up brown if its the first or last word although I did not include this in the example below.

This is just a simple cell with a lot of text for memo descriptions. Should be easy if wildcard, etc., parameters (*=, etc.) are done correctly.

Note: I know FIND easily does this, but I much prefer Autofilter because it uses much less code and no For Each loop..
I really appreciate anyone's help.
Thanks, cr

AUTOFILTER.JPG
 
Last edited by a moderator:

Excel Facts

Select a hidden cell
Somehide hide payroll data in column G? Press F5. Type G1. Enter. Look in formula bar while you arrow down through G.

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,248
Office Version
  1. 365
Platform
  1. Windows
How about
VBA Code:
.AutoFilter 7, "*" & memoval & "*"
 

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
670
How about
VBA Code:
.AutoFilter 7, "*" & memoval & "*"
Hi Fluff - well, it works great - again - seems like just a matter of getting the wildcard, quotes, commas and &'s in the correct places.
cr
 

Fluff

MrExcel MVP, Moderator
Joined
Jun 12, 2014
Messages
68,248
Office Version
  1. 365
Platform
  1. Windows
Glad to help & thanks for the feedback.
 
Master Excel Bundle

Excel contains over 450 functions, with more added every year. That’s a huge number, so where should you start? Right here with this bundle.

Forum statistics

Threads
1,152,405
Messages
5,769,881
Members
425,578
Latest member
Ckrysa

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
Top