combobox change event triggers itself
Posted on 2013-11-08
I have set up a combobox with the option to select 'other'. In this case an input box appears and asks the user to enter the name of the business that is not on the list. That name is then added to the combobox linked range so that it now appears in the combobox.
The problem is that the input box appears a second time asking to input the business name.
It is (I think) due to a change in the list that triggers it for the second time (Because simply typing into the combobox linked range also triggers the input box (But I don't want that to happen). After the second time it doesn't happen and everything carries on just fine.
The code attached to the combobox is:
'the Business Name we want to add
Dim BusinessName As String
'display an input box asking for Business name
BusinessName = InputBox( _
"Type in the name of the Business you want to add, This must MATCH EXACTLY the name of the folder in which the assessment is stored")
'if no Business name added, say so and stop
If Len(BusinessName) = 0 Then
MsgBox "No Business name added"
'enter Business name into combobox list next blank cell
'Assumes no blank rows within your data
Any help much appreciated