This time we use our own “MatchFound” function to check against the data validation’s source list. Otherwise the Exit will be preempted by an “Invalid Property Value” message from Excel.Ĭreating a Data Validation NotInList EventĪs with the combobox version, we use an event to prompt the user whether to add an item that’s not in the list. One important thing is that the combobox’s “MatchRequired” property must be set to False (which is the default). 'if "no", keep focus on the ComboBox and set it's value to "Choose a hat" Add it?", vbYesNo + vbDefaultButton2 + vbQuestion) = vbYes Then 'If the hat entered isn't in list, prompt to add it 'We're only interested if these aren't true Set loValidationSource = wsTables.ListObjects( "tblValidationSource") Private Sub cboHats_Exit( ByVal Cancel As MSForms.ReturnBoolean)ĭim loValidationSource As Excel.ListObject
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |