Contains Filter VBA

pure vito

Board Regular
Joined
Oct 7, 2021
Messages
180
Office Version
  1. 365
Platform
  1. Windows
Hi All,

I have this code that allows me to search trough a list of items and it works great however some of those items contain two words and the filter doesn't
search for that is someone able to amend this code to use a contains filter please, Thanks in advance.


VBA Code:
Private Sub Worksheet_Change(ByVal Target As Range)
'Updateby Extendoffice 20160606
  Application.ScreenUpdating = False
  Range("B10").Select
    Selection.AutoFilter
    Selection.AutoFilter
    Range("B4").Select
   If Target.Address = Range("B4").Address Then
       Range("B11:i30000").CurrentRegion.AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:=Range("B3:B4")
       Application.ScreenUpdating = True
   End If
End Sub
 
Sounds like I am late to the party on all counts. Thanks for the feedback and glad we could help.
 
Upvote 0

Excel Facts

Fastest way to copy a worksheet?
Hold down the Ctrl key while dragging tab for Sheet1 to the right. Excel will make a copy of the worksheet.
@Peter_SSs but but but .... I was busy writing all the reasons why we needed the XL2BB ;). Mine looks just like your although I didn't think to test for no data and I did add screenupdating and enableevent. :(

Peter provided a link the XL2BB web page both under the word and in his sign off.
Images mean we have to manually create the data. It also often also does not provide all the information as is the case with your images. No Row Numbers or Column references, no sheet name and often data types and formulas come into play as well.
Aha you came that's the most important part 😅 thank you ever so much you had the answer I wasn't able to execute it 😬, yes again apologies for the lack of information and I will defiantly look into adding and using XL2BB it did pop up on my document for a short time then disappeared I'll keep working at it, But if the contents of my data sheet sparked any interest please take a look at my document I have spent the best part of a year working on it 😅 you might be able to offer some advise 😁 oh there's a trick to opening the document let me know if you crack it Pokemon Collection Tracker Ver 1.2.xlsm👌 it's a large document and will need downloading
 
Upvote 0
You have way more patience than me. You might want to remove the file though. Unless you know what you are doing it locks up your Excel. I don't think that I used your "trick" to opening it.
 
Upvote 0
That's the intention, I wanted the welcome screen to do that until you exit the screen, you have to press Pikachu's belly to open it up 😅, but yeah I put a lot of time into that and still working on it when I can.
 
Upvote 0
and I did add screenupdating and enableevent. :(
I didn't bother with screen updating as I was in a hurry to rush out for the evening & figured the OP already knew how to do that from the opening post code.
I don't think enableevents is relevant for this code as the code does not trigger itself.
 
Upvote 0

Forum statistics

Threads
1,214,786
Messages
6,121,546
Members
449,038
Latest member
Guest1337

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