Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

combobox change event triggers itself

Posted on 2013-11-08
3
330 Views
Last Modified: 2013-11-08
Hi

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:

Sub Add_business_name()
 
'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"
Exit Sub
End If

'enter Business name into combobox list next blank cell
'Assumes no blank rows within your data
Range("BJ6").Select
Selection.End(xlDown).Select
ActiveCell.Offset(1, 0).Select


End Sub



Any help much appreciated
Dantastico
0
Comment
Question by:dantastico
  • 2
3 Comments
 
LVL 46

Accepted Solution

by:
Martin Liss earned 500 total points
ID: 39634904
You didn't attach a workbook but putting

Application.EnableEvents = False before the code and Application.EnableEvents = True after it might work
0
 

Author Closing Comment

by:dantastico
ID: 39634928
even though I attached the wrong code (DUH), your instant solution worked a treat!
Should have come to you days ago
0
 
LVL 46

Expert Comment

by:Martin Liss
ID: 39634961
I've had it happen to me more than once so the answer was easy, but I'll still take the points:) In any case you're welcome and I'm glad I was able to help.

Marty - MVP 2009 to 2013
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Microsoft Office Picture Manager was included in Office 2003, 2007, and 2010, but not in Office 2013. Users had hopes that it would be in Office 2016/Office 365, but it is not. Fortunately, the same zero-cost technique that works to install it with …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question