View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson Dave Peterson is offline
external usenet poster
 
Posts: 35,218
Default MatchRequired - how to trap the error when a matching entry is notinput

I didn't suggest using a listbox. I suggested changing the style from a
combobox--where you can choose from the list or type something new to a combobox
where you can only type what's in the list (or choose from that list).

You may want to look at that one more time.

exceltim wrote:

Thanks very much for your suggestions guys....

I ended up doing something similar to Toppers' suggestion (I didn't
want to change it to a listbox because of the nature & purpose of the
form).... here's my code:

Private Sub ComboBox1_BeforeUpdate(ByVal Cancel As
MSForms.ReturnBoolean)
If ComboBox1.MatchFound = False And ComboBox1.Text < "" Then
MsgBox "Invalid entry. Please select from the available list"
Cancel = True
ComboBox1.Text = ""
End If
End Sub

Cheers,

Tim

--
exceltim
------------------------------------------------------------------------
exceltim's Profile: http://www.excelforum.com/member.php...o&userid=30464
View this thread: http://www.excelforum.com/showthread...hreadid=501310


--

Dave Peterson