Solved

combo box event...

Posted on 2014-04-17
3
254 Views
Last Modified: 2014-04-17
On Sheet1!C2 there is a combo box displaying data from Sheet2!L3:L26.

Q1: How this is built?

Q2: Upon a selection from the combo box at Sheet1!C2, how can I have a message box showing the value of the selected item.

FYI, later I will add codes to this event to perform some other task.


Thank you.

Excel 2013
0
Comment
Question by:Mike Eghtebas
[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 22

Accepted Solution

by:
Flyster earned 500 total points
ID: 40007966
From the developer tab select Insert - Active X Controls - Combobox. Place the combobox where you want. Right-click the combobox and select properties. Under ListFillRange enter "Sheet2!L3:L26" (Without quotes.) Right-click the combobox again and select view code. Enter this:

Private Sub ComboBox1_Change()
Dim msg As String
  msg = MsgBox("Combobox1 value is " & Me.ComboBox1.Value, vbOKOnly)
End Sub

This will give you a messagebox showing what the selected value is. See atrrached.

Flyster
Combobox.xlsm
0
 
LVL 34

Author Comment

by:Mike Eghtebas
ID: 40007977
Thank you for the good post.

How, can I add and event to the existing combo box? After a right-click, it doesn't give view code option.

Mike
0
 
LVL 34

Author Closing Comment

by:Mike Eghtebas
ID: 40007982
Thank you.

It gives me record macro option with this version of Excel. So, after recording something simple, then with a right click again I choose edit macro to access the event.
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction While answering a recent question (http:/Q_27311462.html), I created an alternative function to the Excel Concatenate() function that you might find useful.  I tested several solutions and share the results in this article as well as t…
How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

738 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