Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
concatenting rows for excel combo box output
Step 1 of what I wish to accomplish:
I have two rows, col A and Col B. ColA is for First Name and Col B is for Last Name. I want to present a combo box that displays the contents of these rows as if the data were from one single row Step 2 of what I wish to accomplish: Once the user makes the selection in the combo box I want the output to essentially concatentate the Col A and Col B for the selected row so that if for example they choose from the combo list: Joe Smith The resulting entry into the destination field would be Joe Smith. Not merely Joe. |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
concatenting rows for excel combo box output
Use code like the below to fill the combobox. Then the result will be the
selected item in the combobox. set rng = Range(Range("A2"),Range("A2").End(xldown)) for each cell in rng me.combobox1.AddItem = cell.Value & _ " " & cell.offset(0,1).Value Next "Alex" wrote: Step 1 of what I wish to accomplish: I have two rows, col A and Col B. ColA is for First Name and Col B is for Last Name. I want to present a combo box that displays the contents of these rows as if the data were from one single row Step 2 of what I wish to accomplish: Once the user makes the selection in the combo box I want the output to essentially concatentate the Col A and Col B for the selected row so that if for example they choose from the combo list: Joe Smith The resulting entry into the destination field would be Joe Smith. Not merely Joe. |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
concatenting rows for excel combo box output
Thank you Tom, the code you sent worked great. I really appreciate the
help! :) Tom Ogilvy wrote: Use code like the below to fill the combobox. Then the result will be the selected item in the combobox. set rng = Range(Range("A2"),Range("A2").End(xldown)) for each cell in rng me.combobox1.AddItem = cell.Value & _ " " & cell.offset(0,1).Value Next "Alex" wrote: Step 1 of what I wish to accomplish: I have two rows, col A and Col B. ColA is for First Name and Col B is for Last Name. I want to present a combo box that displays the contents of these rows as if the data were from one single row Step 2 of what I wish to accomplish: Once the user makes the selection in the combo box I want the output to essentially concatentate the Col A and Col B for the selected row so that if for example they choose from the combo list: Joe Smith The resulting entry into the destination field would be Joe Smith. Not merely Joe. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Combo box output excel 2007 | Excel Discussion (Misc queries) | |||
Combo Box - How to Use Output in Vlookup | Excel Discussion (Misc queries) | |||
Formatting Output Range in Combo Box | Excel Discussion (Misc queries) | |||
concatenting dates showing m/d instead of m/d/y | Excel Programming | |||
Combo Box - format output as time | Excel Discussion (Misc queries) |