6

I have a user form (excel, VBA) where there is a 2 column combobox. When user selects a certain value from the combobox, I want to get the value he selected, and the value associated with the first value (ie. the second column value).

How do I do this? Simply ComboBox1.Value returns the value of the first column. ComboBox1.Value(0) doesn't work.

Community
  • 1
  • 1
emihir0
  • 1,200
  • 3
  • 16
  • 39

1 Answers1

16

Use the column property of the combobox. It is 0-based so the first column is column(0) and the second column is column(1).

Me.ComboBox1.Column(1)
  • at the end if you want both of them it should be something like this : `Me.ComboBox1.Column(0) & " " & Me.ComboBox1.Column(1)` – Dubison Apr 28 '15 at 16:16