Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Combo Grief
I guess if you want to override one of Excel's features you have to
write your own. This was an interesting exercise - perhaps you can adapt it to what you want :- '------------------------------------------------------ '- This is Test code - hence bad programming technique '- The _Change event fires as each character is typed. '------------------------------------------------------ Private Sub ComboBox1_Change() Dim MyArray As Variant Dim Valid As Boolean MyArray = Array("AAAA", "AABB", "AAAC") cb1 = ComboBox1.Value Ln = Len(cb1) Valid = False '- check For n = 0 To 2 If cb1 = Left(MyArray(n), Ln) Then Valid = True Next If Valid = False Then MsgBox ("Please use type a valid entry") ComboBox1.Value = Left(cb1, Ln - 1) End If End Sub '-------------------------------- Regards BrianB ========================================= "Kevin McCartney" wrote in message ... Hi, I have a combo box on a form, its populated with an array and the most important settings for the combo box which I think my problem relates to a MatchEntry: 1 - frmEntryComplete MatchRequired: True. If I type in any old rubish so as not to match an entry I get the message 'Invalid property value', but I'd like to change this message but can't find or know where to replace this message. I thought of some sub procedure like a Not In List similar to Access, thus if no match clear the entry and ask the user to try again. Thank for you help |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
linking a form combo box... results from the combo box to another | Excel Discussion (Misc queries) | |||
combo reference on another combo box for picking address etc. | Excel Worksheet Functions | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) | |||
"Combo Box - getting control combo box to stick in place in worksh | Excel Discussion (Misc queries) | |||
3 problems giving me grief. Any help appreciated. | Excel Programming |