Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 288
  • Last Modified:

combo box event...

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
Mike Eghtebas
Asked:
Mike Eghtebas
  • 2
1 Solution
 
FlysterCommented:
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
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
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
 
Mike EghtebasDatabase and Application DeveloperAuthor Commented:
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
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now