"implant" ActiveX ComboBox value into if eq'n

S

Steve

Morning all.
Ok, I've got my combox active to where I can read the names in the list.
I'd now like to have an if equation that will pull the value I select in the
combobox.

Do I have to write a secondary macro/function for that, or can I do it
directly on the worksheet?
 
P

Philosophaie

Private Sub ComboBox1_Change()
Select Case ComboBox1.Text
Case "Item1"
MsgBox ("Item1")
Case "Item2"
MsgBox ("Item2")
Case "Item3"
MsgBox ("Item3")
Case "Item4"
MsgBox ("Item4")
Case "Item5"
MsgBox ("Item5")
End Select
End Sub

Substitute the name of the text and the code you want to execute for the
Msgbox .
 
P

Philosophaie

Make sure "Combobox_Change" is in "Sheet1", "Sheet2", etc. not in
"ThisWorkbook" where you add the names:

Sheets("Sheet1").Combobox1.additems "Name1", etc
 
S

Steve

Hi "Phil"
Let me guess, you're a Newton fan (his big Principia Phil. text).

Let me understand this...
I need to place the code you offered in the workbook that my comboboxes are
in-- and not my source list workbook?

I.e., my source list is located in my personal.xlsb workbook.

We've been making all our macros as globals, by either placing them in the
personal.xlsb, or our xlam files.

I prefer to keep it that way.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top