combobox

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I am using Excel 97, I have an array in vba for the
dropdown.

If a user types something in the combobox which isn't in
the array, is there a way to check the array and if it
isn't listed to continue and change the entry of another
cell say?

Can someone help please?


Mark
 
I think from your post you need to look at the limit to
list of the combo.
 
Can you explain further, please?

Mark
-----Original Message-----
I think from your post you need to look at the limit to
list of the combo.
.
 
Hello Mark
Not too sure I understand!
If you wish to have an additionnal element in your combo and your source
range when user types a non-matching value then you could do something like
this (please amend accordingly and note that I am referencing the sheet's
codename and items are added with the combobox.Additem method in the
Userform_Initialize event):
Private Sub ComboBox1_AfterUpdate()
If Not ComboBox1.MatchFound Then
If MsgBox("Add new item " & ComboBox1.Value, vbYesNo + vbQuestion, _
"Not in list") = vbYes Then
ComboBox1.AddItem ComboBox1.Value
Feuil1.Range("A65536").End(xlUp)(2).Value = ComboBox1.Value
End If
End If
End Sub

HTH
Cordially
Pascal
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

Combobox filtering 2
vba array logic 3
Combobox release 4
ComboBox Dropdown not under control 1
MSForms 2.0 Combobox problem 1
combobox 4
String array to a comboBox 1
ComboBox Update 2

Back
Top