April 2006
Beginner
1114 pages
98h 16m
English
control.BoundColumn [= setting]
Sets or returns the index of the column that determines the Value property of the control. The following code loads three columns of data from the DataForm worksheet into a combo box and displays the value of the third column when the user selects an item from the list:
Private Sub UserForm_Initialize( )
Dim rng As Range
ComboBox1.ColumnCount = 3
Set rng = Worksheets("DataForm").UsedRange
ComboBox1.RowSource = rng.Address
ComboBox1.BoundColumn = 3
End Sub
Private Sub ComboBox1_Change( )
If ComboBox1.Value <> "" Then _
MsgBox "Selected value is: " & ComboBox1.Value
End SubRead now
Unlock full access