PC Review


Reply
Thread Tools Rate Thread

concatenting rows for excel combo box output

 
 
Alex
Guest
Posts: n/a
 
      22nd Nov 2006
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 With Quote
 
 
 
 
=?Utf-8?B?VG9tIE9naWx2eQ==?=
Guest
Posts: n/a
 
      22nd Nov 2006
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 With Quote
 
Alex
Guest
Posts: n/a
 
      23rd Nov 2006
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 With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Combo box output excel 2007 Dan Microsoft Excel Misc 2 14th May 2010 03:49 PM
Output array to Excel blank rows separating groups ghh3rd Microsoft Excel Programming 0 1st Mar 2006 07:52 PM
In Excel my autofilter? is omitting some data rows from output =?Utf-8?B?UGVycGxleGVkIEplZmY=?= Microsoft Excel Programming 1 5th Jul 2005 01:29 PM
Too many rows for Excel output from Access 2000 vtreddy Microsoft Access Queries 1 8th Jan 2004 12:14 AM
Too many rows for Excel output from Access 2000 vtreddy Microsoft Access 1 8th Jan 2004 12:14 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:23 AM.