#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default Combo box

I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3 columns
and up to 10 rows.

Can you help me with the code.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Combo box

maybe someone else has another way, but this is just using formulas.

i used a helper column to concatenate the names, column d in this instance.
so, in a2:
=B2&" "& C2 &" "&A2
and auto filled down

then create a named range using a dynamic range:
i named it employees and entered this in the refers to box:
=OFFSET(Sheet1!$D$2,0,0,COUNTA(Sheet1!$D:$D),1)

then in the combobox, i'm assuming it's on the sheet and not in a form,
enter this into the input box on the control tab:
employees

--

Gary


"Rick" wrote in message
...
I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3
columns
and up to 10 rows.

Can you help me with the code.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 364
Default Combo box

forgot to mention, if you actually want code, just post back.

--

Gary


"Rick" wrote in message
...
I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3
columns
and up to 10 rows.

Can you help me with the code.


  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default Combo box

Rick,
You can place a ComboBox from the controls toolbox on your sheet,.
Select design mode then right click, Properties

In the Alphabetic list of Properties
Depending on what you want to return from the selection set the
BoundColumn 1 will be LastName
Make ColumnCount 3
You can play with the ColumnWidth for each part of the name perhaps
50,15,50
LinkedCell wherever you want the result output to
ListFillRange A1:C100 or however many
ListRows 10

You can do this as code, as well but if this would work for you it is
pretty simple.

Scott



On Thu, 21 Feb 2008 21:25:00 -0800, Rick
wrote:

I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3 columns
and up to 10 rows.

Can you help me with the code.

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Combo box

If you are really looking for VBA code, give this a try...

Sub FillComboBox()
Dim X As Long
ComboBox1.Clear
For X = 2 To ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
ComboBox1.AddItem Replace(Cells(X, "B").Value & " " & _
Cells(X, "C").Value & " " & _
Cells(X, "A").Value, " ", " ")
Next
End Sub

The code assumes your names start in Row 2 (with Row 1 being the header row)
and will fill down to the last name (using Column A).

Rick


"Rick" wrote in message
...
I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3
columns
and up to 10 rows.

Can you help me with the code.




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 334
Default Combo box

Thanks to all of you, this helped to get me started.

"scott" wrote:

Rick,
You can place a ComboBox from the controls toolbox on your sheet,.
Select design mode then right click, Properties

In the Alphabetic list of Properties
Depending on what you want to return from the selection set the
BoundColumn 1 will be LastName
Make ColumnCount 3
You can play with the ColumnWidth for each part of the name perhaps
50,15,50
LinkedCell wherever you want the result output to
ListFillRange A1:C100 or however many
ListRows 10

You can do this as code, as well but if this would work for you it is
pretty simple.

Scott



On Thu, 21 Feb 2008 21:25:00 -0800, Rick
wrote:

I have a Accounts sheet that contains the following:
Col-A = Last Name
Col-B = First Name
Col-C = M.I.

I want to load a combo_box on the Invoice sheet with data from all 3 columns
and up to 10 rows.

Can you help me with the code.


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
Combo Box vba that works like Forms Menu combo box Hector Fernandez Excel Programming 4 December 12th 06 08:30 PM
Excel VBA Combo Box Populating dependent on other combo box choices ikabodred Excel Programming 1 March 15th 06 03:16 PM
Filtered list for Combo Box ListFillRange - Nested Combo Boxes DoctorG Excel Programming 3 February 23rd 06 12:15 PM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 1 February 16th 05 02:05 AM
"Combo Box - getting control combo box to stick in place in worksh ajr Excel Discussion (Misc queries) 0 February 15th 05 07:45 PM


All times are GMT +1. The time now is 03: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"