Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 6,953
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 5
Default 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
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 output excel 2007 Dan Excel Discussion (Misc queries) 2 May 14th 10 03:49 PM
Combo Box - How to Use Output in Vlookup opieandy Excel Discussion (Misc queries) 4 July 5th 09 04:32 AM
Formatting Output Range in Combo Box V2 Excel Discussion (Misc queries) 2 February 23rd 09 01:10 PM
concatenting dates showing m/d instead of m/d/y don Excel Programming 2 February 18th 06 03:00 AM
Combo Box - format output as time Robert Mark Bram Excel Discussion (Misc queries) 1 December 5th 05 12:30 AM


All times are GMT +1. The time now is 12:57 AM.

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"