Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Milti Column Combobox

I have a form with a multicolumn combobox (CBNames). it gets its list from
columns a, B, and C of a worksheet. (Number, FirstName, LastName) i have the
column count set at 3, and the column widths set appropriately. when a user
clicks the arrow to "Drop Down" the combobox, and he/she selects an item from
the list, what is shown in the box is just the number, the first column. is
there a way to get it to display all 3 items for that row in the combobox
after it is selected? TIA
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,253
Default Milti Column Combobox


you can select 1 column to be displayed
when the combobox is not 'dropped'.

You do this by setting the TextColumn = 2
and it will show the second column.

To display the concatenated name you'd have to include
a fourth column with the data you want displayed.

If you dispense with the convenience of
using ListFillRange but populate the combo's list
yourself then you dont need need to change your actual data.

Sub Combofill()

Dim itm As Range

With Me.ComboBox1
'this ought to be set in designer
.ListFillRange = ""
.ColumnCount = 4
.ColumnWidths = "18pt;72pt;72pt;0"
.BoundColumn = 1
.TextColumn = 4

'this would normally run
.Clear
For Each itm In Range("a1:a40")
If itm(1, 1) < "" Then
.AddItem itm(1)
.List(.ListCount - 1, 1) = itm(1, 2)
.List(.ListCount - 1, 2) = itm(1, 3)
.List(.ListCount - 1, 3) = itm(1, 2) & ", " & itm(1, 3)
End If
Next
End With
End Sub






--
keepITcool
| www.XLsupport.com | keepITcool chello nl | amsterdam


Virginia wrote :

I have a form with a multicolumn combobox (CBNames). it gets its
list from columns a, B, and C of a worksheet. (Number, FirstName,
LastName) i have the column count set at 3, and the column widths set
appropriately. when a user clicks the arrow to "Drop Down" the
combobox, and he/she selects an item from the list, what is shown in
the box is just the number, the first column. is there a way to get
it to display all 3 items for that row in the combobox after it is
selected? TIA

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Excel VBA Multi Column ComboBox jlclyde Excel Discussion (Misc queries) 3 October 15th 09 04:21 PM
Multi Column ComboBox Steve Roberts Excel Programming 0 March 29th 05 07:17 PM
Populate Column Header on ComboBox michael_13143 Excel Programming 1 April 23rd 04 05:45 PM
Filename and creation timestamp in 2-column combobox L Mehl Excel Programming 4 February 10th 04 12:40 AM
Multiple Column ComboBox using Additem Jimmi Excel Programming 2 September 24th 03 02:40 AM


All times are GMT +1. The time now is 01:43 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"