Shorten Data Validation List

FryGirl

Well-known Member
Joined
Nov 11, 2008
Messages
1,364
Office Version
  1. 365
  2. 2016
Platform
  1. Windows
I have downloaded and used a workbook from Contextures.com which works great for condensing the pick from a DV list. Instead of filtering from the beginning of the word, how can this become a wildcard? Example, in the file, if I only wanted to see names that contained the combination "be"? That would only return Bell and Imber.

FL0024 - Shorten Data Validation List

My thought would be to add wildcards, but evidently this approach is not right.

VBA Code:
NamesSort ("*" & "CriteriaLetter" & "*")

VBA Code:
Option Explicit
' Developed by Contextures Inc.
' www.contextures.com
Private Sub Worksheet_Change(ByVal Target As Range)
Dim wsSD As Worksheet
Dim wsS As Worksheet
On Error GoTo errHandler
Set wsSD = Sheets("Sales Data")
Set wsS = Sheets("Summary")
Application.EnableEvents = False
Select Case Target.Address
Case wsS.Range("LetterSel").Address
Target.Value = UCase(Target.Value)
wsS.Range("NameSel").ClearContents
NamesSort ("CriteriaLetter")

If Target.Value = "" Then
wsS.Range("ExtractOrders").CurrentRegion.Offset(1, 0).ClearContents
Else
OrderSort ("CriteriaLetter")
End If

Case wsS.Range("NameSel").Address
If Target.Value = "" Then
NamesSort ("CriteriaLetter")
If wsS.Range("LetterSel").Value = "" Then
wsS.Range("ExtractOrders").CurrentRegion.Offset(1, 0).ClearContents
Else
OrderSort ("CriteriaLetter")
End If
Else
OrderSort ("CriteriaName")
End If
Case Else
'do nothing
End Select

exitHandler:
Application.EnableEvents = True
Exit Sub
errHandler:
MsgBox "Could not filter orders"
Resume exitHandler
End Sub
 

Excel Facts

Excel Wisdom
Using a mouse in Excel is the work equivalent of wearing a lanyard when you first get to college
Bump. Does anybody have a thought on this?
 
Upvote 0
Upvote 0
Thanks Akuini. Both of those were great solutions and surely one of these will work. I'm leaning towards the first link, but will have to see how it fits in with my overall project. Thanks again. :)
 
Upvote 0
You're welcome, come back anytime if you need help.
 
Upvote 0

Forum statistics

Threads
1,214,914
Messages
6,122,211
Members
449,074
Latest member
cancansova

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