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

chazrab

Well-known Member
Joined
Oct 21, 2006
Messages
884
Office Version
  1. 365
Platform
  1. Windows
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

Bring active cell back into view
Start at A1 and select to A9999 while writing a formula, you can't see A1 anymore. Press Ctrl+Backspace to bring active cell into view.
How about
VBA Code:
.AutoFilter 7, "*" & memoval & "*"
 
Upvote 0
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
 
Upvote 0
Glad to help & thanks for the feedback.
 
Upvote 0

Forum statistics

Threads
1,214,889
Messages
6,122,097
Members
449,065
Latest member
albertocarrillom

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