Microsoft Office Forums

Go Back   Microsoft Office Forums > Microsoft Excel > Excel Programming

Reply
 
LinkBack Thread Tools Display Modes
  #1  
Old 10-06-2017, 03:45 PM
LearnerExcel LearnerExcel is offline Windows 7 32bit Office 2003
Novice
 
Join Date: Nov 2016
Posts: 13
LearnerExcel is on a distinguished road
Default How to use wild card in VBA for Advance Filter?


I have the following VBA Code which filters data but if I type starting text in excel search field. It doesn't filter date if it is from the middle of the cell.

For Example, Cell B7 Contains text "Starting Data File & Middle File" and when I type in Cell B2 (Search Criteria Cell) "Starting" it shows the result. But if I type "Middle File" it won't show any records. How can I resolve this issue? How to use the wildcard here in VBA?

Code:
Sub SearchMe()
' SearchMe Macro
    Range("B5:J1000").AdvancedFilter Action:=xlFilterInPlace, CriteriaRange:= _
        Range("ComparisonFilterInPlace!B2:J3"), Unique:=False
End Sub
Reply With Quote
  #2  
Old 10-09-2017, 12:27 AM
Debaser Debaser is offline Windows 7 64bit Office 2010 32bit
Competent Performer
 
Join Date: Oct 2015
Posts: 135
Debaser is on a distinguished road
Default

If you want records that end in "Middle File", use "*Middle file" in the cell (without the quotes). Or for contains Middle File, use "*Middle file*".
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
find with wild cards and add into CC sylvio Word VBA 2 09-04-2017 01:00 AM
ID Card Template Jenna Deakin Word 0 08-09-2017 06:36 AM
Filter Mail Merge based on a list of filter criteria AusSteelMan Mail Merge 2 05-09-2016 03:35 PM
Question about find and replace wild cards catherineliang Word 1 07-21-2014 09:42 PM
Wild card to highlight capitalised terms? bertietheblue Word 2 02-08-2013 04:44 PM


All times are GMT -7. The time now is 04:03 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
SEO by vBSEO ©2011, Crawlability, Inc.
MSOfficeForums.com is not affiliated with Microsoft