predictive text in List dropdown

VisualBasic

New Member
Joined
Oct 31, 2011
Messages
9
Hi all,

I have a list of locations, I then clicked another cell went to Data tab and selected Data Validation, and then clicked under "Allow" the List option and for source I put the range of my locations.

So I now have a list dropdown of locations.

What I need to do is add predicitive text to this, so when the user selects L, it for example shows london. This works when u use the filter option, but I need it to work using List Dropdown, is this possible, >???? maybe via VBA code.
 

Excel Facts

How can you turn a range sideways?
Copy the range. Select a blank cell. Right-click, Paste Special, then choose Transpose.
Hi, this doesnt meet my requirement, cause if i type in the combo box feb..i would want it to auto predict february...

please help me
 
Upvote 0
Hi, I am looking for something similar to this and it works perfectly if the 'data validation list' equals an array that's on the same worksheet. Although, I have some lists on that worksheet that equal arrays from different worksheets within the same workbook. Is there a code that you know of that can be entered in so that it changes all the 'Data Validation Lists' in the workbook so that they can become predictive texts?

I am also not too sure if this works with merged cells, is there a way to make it work for merged cells too?

Your expert advice would be greatly appreciated

-Dan
 
Upvote 0
Hi, this doesnt meet my requirement, cause if i type in the combo box feb..i would want it to auto predict february...

please help me


I am looking for a similar solution. But to clarify the solution above if you type in "m" can't the list truncate down to March and May only?

In my case I want to use it with part numbers and there are about 1000+ items which are similar codes ie: PRT147, PRT155, PRT 987... If I type PRT I'd like it to give me my options or if I type PRT1 again it would isolate those with PRT1 as part of the part number.
 
Upvote 0
I know this is very old but here's my vba solution to auto populate a cell with a data validation if the user types on the beginning string of one of the elements in the list. Will require turning OFF the Error Alert.

Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim strarray As String
Dim strunbound() As String
Dim i As Long
On Error Resume Next
If Target.SpecialCells(xlCellTypeSameValidation).Cells.Count <> "" Then
strarray = Target.Validation.Formula1 'or any string with unique dilimiter
strunbound = Split(strarray, ",") 'replace vbCrLf with any unique delimiter such as ","
For i = LBound(strunbound) To UBound(strunbound)
If InStr(strunbound(i), Target) > 0 Then
Target.Value = strunbound(i)
Exit Sub
End If
Next i
End If
Resume Next
End Sub
 
Upvote 0
Roderick,

Thanks for the post, I'll try it out.


Thanks again
 
Upvote 0

Forum statistics

Threads
1,214,424
Messages
6,119,400
Members
448,893
Latest member
AtariBaby

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