Advanced Filter if word contains - Macro

brois

New Member
Joined
Oct 30, 2017
Messages
2
I would like to add a "search" or "if contains" as an addition to my advanced filter set up as a macro. Right now it is processing if my search term (B3) is the first word in my range, however I am marking my list with tags and would like it the return results if other tag words if selected and not the first word in the range cell.

Example: B3 = cstore

Return: Cell example 1 [cstore, gpa, lottery, purchase, instore product, gas station] will return BUT NOT cell example 2 [transit, cstore, truckside, buswraps, commut]

How do I set up the below macro to also return cell 2? I need the ranges of A1:F200 and copy range of A5:F205 to stay the same as there is information between A through F that need to show as well.



<style type="text/css">p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #000000 ; background-color: #ffffff}p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #008f00 ; background-color: #ffffff}p.p3 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #011993 ; background-color: #ffffff}span.s1 {color: #011993 }span.s2 {color: #000000 }</style>Sub Go()
'
' Go Macro
'
' Keyboard Shortcut: Option+Cmd+g
'
Sheets("List").Range("A1:F200").AdvancedFilter Action:=xlFilterCopy, _
CriteriaRange:=Range("$B$2:$B$3"), CopyToRange:=Range("A5:F205"), Unique:= _
False
End Sub
AF1QipPvuvnsUwHxwqvFCCdkW9cJFU22ybRx-AQs5fd-


Thank you!!!
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
Welcome to the Board!

Put this in cell B3:
Code:
*cstore*

In your CopyToRange, only put the top left-most cell that you want to start pasting the data to.
 

Joe4

MrExcel MVP, Junior Admin
Joined
Aug 1, 2002
Messages
58,249
Office Version
  1. 365
Platform
  1. Windows
You are welcome.
 

Forum statistics

Threads
1,136,275
Messages
5,674,782
Members
419,524
Latest member
helensesc

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