Using a Wild Card in an Auto Filter

Guzzlr

Well-known Member
Joined
Apr 20, 2009
Messages
982
Office Version
  1. 2021
Platform
  1. Windows
Hello All...

Code:
'**************** Build Zone 1 ********************
Sheets("Alignment").Select
With Range("B4:AG1300")
.AutoFilter Field:=12, Criteria1:="1-1"
Range("B4:AG1300").Copy
Sheets.Add(After:=Sheets(Sheets.Count)).Name = "Zone 1"
Range("A3").Select
Selection.PasteSpecial Paste:=xlPasteValues
.AutoFilter
Range("A1").Select
End With

The following code will find 1-1 for Criteria1, and is working.
My question:
What if I want to find all numbers in field 12 with numbers based upon "1-"?
For example, not only "1-1", but maybe "1-8" or maybe "1-0" etc...
How can I have a wildcard past the 1- to find all Criteria1 based upon "1-"

probably doesn't make a whole lot of sense, I don't know how to explain it...sorry
Thanks for the help
 

Excel Facts

Best way to learn Power Query?
Read M is for (Data) Monkey book by Ken Puls and Miguel Escobar. It is the complete guide to Power Query.
"1-*" will work but will return all entries that start with "1-" and not discriminate numbers or text. You may want to try "1-?" for one strictly one character after the "1-"
 
Upvote 0
Code:
"1-*" will work but will return all entries that start with "1-" and not discriminate numbers or text.

This is working well, thank you
 
Upvote 0

Forum statistics

Threads
1,223,911
Messages
6,175,327
Members
452,635
Latest member
laura12345

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