Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

combobox change event triggers itself

Posted on 2013-11-08
3
Medium Priority
?
338 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
[X]
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
  • 2
3 Comments
 
LVL 49

Accepted Solution

by:
Martin Liss earned 2000 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 49

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

Fill in the form and get your FREE NFR key NOW!

Veeam® is happy to provide a FREE NFR server license to certified engineers, trainers, and bloggers.  It allows for the non‑production use of Veeam Agent for Microsoft Windows. This license is valid for five workstations and two servers.

Question has a verified solution.

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

How to get Spreadsheet Compare 2016 working with the 64 bit version of Office 2016
Cancel future meetings from user mailboxes in Office 365 using Remove-CalendarEvents
This Micro Tutorial demonstrates using Microsoft Excel pivot tables, how to reverse engineer competitors' marketing strategies through backlinks.
This Micro Tutorial will demonstrate the scrolling table in Microsoft Excel using the INDEX function.

609 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