ComboBox selected record’s all columns visible?

Sahak

Well-known Member
Joined
Nov 10, 2006
Messages
1,012
Office Version
  1. 2016
  2. 2013
  3. 2011
  4. 2010
  5. 2007
Hi all,

After DropButton Clicking, it shows all CoboBox’s records with columns visible, but after selecting a record from list, CoboBox shows first column’s value only, rest columns are hidden. Is there a way to show selected record’s all columns?

Thank you in advance
 

Excel Facts

Will the fill handle fill 1, 2, 3?
Yes! Type 1 in a cell. Hold down Ctrl while you drag the fill handle.
You can give more detail than you have.
Is the combobox on the sheet? It is a combobox of userform or ActiveX control.
Or is it a combobox in a userform?
You have a code to load the data into the combobox, you can put that code here.
 
Upvote 0
Thank you Dante for reply, the combo on Userform & its RowSource comes from worksheet records range, let say four columns & ten rows
 
Upvote 0
You have a code to load the data into the combobox, you can put that code here.
 
Upvote 0
Code:
Private Sub UserForm_Initialize()
    Combo_Employees.RowSource = "Employee_Records_Rng"
    '............
    '............
End Sub
 
Upvote 0
ok, I already understood what the problem is.Give me a moment to review it.
 
Last edited:
Upvote 0
CoboBox shows first column’s value only, rest columns are hidden.
That happens, because in the combo value you can only have one column.

Is there a way to show selected record’s all columns?

To add the 4 columns, I am concatenating the 4 columns into a single value.


Try this:

Code:
Dim [COLOR=#0000ff]loading [/COLOR]As Boolean  [COLOR=#008000]'To the top of all the code[/COLOR]


Private Sub Combo_Employees_Change()
  With Combo_Employees
    If .Value = "" Then Exit Sub
    If .ListIndex = -1 Then Exit Sub
    If [COLOR=#0000ff]loading [/COLOR]= True Then Exit Sub
    [COLOR=#0000ff]loading[/COLOR] = True
    .Value = .List(.ListIndex, 0) & " " & .List(.ListIndex, 1) & " " & _
             .List(.ListIndex, 2) & " " & .List(.ListIndex, 3)
  End With
  [COLOR=#0000ff]loading [/COLOR]= False
End Sub


Private Sub UserForm_Initialize()
  [COLOR=#0000ff]loading [/COLOR]= True
  Combo_Employees.RowSource = "Employee_Records_Rng"
  [COLOR=#0000ff]loading [/COLOR]= False
  '...
  '...
End Sub
 
Upvote 0
Yes, concatenating will work, but not separate, i see, it cant be done. Thank you very much for trying to help me, have a nice day.
 
Upvote 0
You can leave the data of the first column in the combobox and concatenate the 4 columns in a label, for example.
 
Upvote 0

Forum statistics

Threads
1,223,445
Messages
6,172,181
Members
452,447
Latest member
willsing5130

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top