View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Dave Peterson[_5_] Dave Peterson[_5_] is offline
external usenet poster
 
Posts: 1,758
Default Grabbing Data From Second Combo Box Column

I put a combobox in a userform and added a couple of commandbuttons. This is
the code I used:

Option Explicit
Private Sub CommandButton1_Click()
Unload Me
End Sub
Private Sub CommandButton2_Click()
With Me.ComboBox1
If .ListIndex -1 Then
MsgBox (.List(.ListIndex, 1))
End If
End With
End Sub
Private Sub UserForm_Initialize()
With Me.ComboBox1
.ColumnCount = 2
.RowSource _
= Worksheets("sheet1").Range("a1:B10").Address(exter nal:=True)
End With
End Sub

And it seemed to work ok for me.

DBAL wrote:

Hello,
Can one of you masters show me the syntax for grabbing the data out of the
second column of my two-column combo box?

My combo box is called cmbxCustomerSelection and the
cmbxCustomerSelection.text property returns the first column's data.
But how can I access the second column's data?

Thanks,
DBAL.


--

Dave Peterson