+ Reply to Thread
Results 1 to 5 of 5

Concatenate all cells in a row to the last cell with data.

  1. #1
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Concatenate all cells in a row to the last cell with data.

    I'm in need of a method to concatenate each row from B1 to the last cell with data on the same row. ( it varies)
    The maximum range I might need would be B1:CD1
    I'm unable to add each cell within the function, as its too large.

    I have about 100 rows like this.

    Any ideas?

    Thanks!

  2. #2
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Concatenate all cells in a row to the last cell with data.

    a user defined function maybe?

    Please Login or Register  to view this content.
    Attached Files Attached Files
    Last edited by mehmetcik; 10-02-2014 at 04:09 PM.

  3. #3
    Forum Guru sktneer's Avatar
    Join Date
    04-30-2011
    Location
    Kanpur, India
    MS-Off Ver
    Office 365
    Posts
    9,649

    Re: Concatenate all cells in a row to the last cell with data.

    This can easily be achieve with the help of a VBA code. But as far as the formula is concerned, you need several steps to achieve this. Lets take a simple and small example of this.
    Lets say you have values in the range B1:K1 from 1 to 10.

    Step 1. Type the following formula in the formula cell but don't press Enter.
    Please Login or Register  to view this content.
    Step 2. Now without pressing Enter, click in the formula bar and select the red colored range in the formula bar
    Please Login or Register  to view this content.
    Step 3. After selecting the red range, press F9 (Function Key) and your formula will become like this in the formula bar.
    Please Login or Register  to view this content.
    Step 4. Now delete the curly brackets (shown above in red)from the formula in the formula bar and your formula will look like this...
    Please Login or Register  to view this content.
    Step 5. Now press Enter to confirm the formula and you will get the following concatenated string in the formula cell.
    Please Login or Register  to view this content.
    If you want to use , (comma) as a separator, you may start with the following formula in step 1.
    Please Login or Register  to view this content.
    and select everything inside the brackets (shown below) before going to the step 3.
    Please Login or Register  to view this content.
    You may also use the key combination Ctrl + Shift + Right Arrow Key to select the data in a row i.e. select B1 and then use this key combination to select last cell with data in row1.

    Does this help?
    Regards
    sktneer


    Treat people the way you want to be treated. Talk to people the way you want to be talked to.
    Respect is earned NOT given.

  4. #4
    Forum Expert
    Join Date
    12-14-2012
    Location
    London England
    MS-Off Ver
    MS 365 Office Suite.
    Posts
    8,448

    Re: Concatenate all cells in a row to the last cell with data.

    Following on from sktneer's suggestions

    this version accepts an optional text deliminator

    Please Login or Register  to view this content.
    Attached Files Attached Files

  5. #5
    Registered User
    Join Date
    01-25-2009
    Location
    Florida, USA
    MS-Off Ver
    Excel 2003
    Posts
    78

    Re: Concatenate all cells in a row to the last cell with data.

    Thanks, sktneer

    That's an interesting way to get the same result. Although I'm not sure if this method will work if my data is continuously being updated.


    mehmetcik, Your code worked great!! ( and thanks for the included xlsm file!)


    Thanks guys!

    Cheers

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Replies: 9
    Last Post: 12-13-2013, 07:40 PM
  2. Replies: 3
    Last Post: 09-20-2012, 04:26 PM
  3. Replies: 2
    Last Post: 04-12-2010, 12:35 PM
  4. Replies: 0
    Last Post: 04-07-2009, 04:42 PM
  5. formula to concatenate cells with data
    By tryer in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 02-06-2009, 05:43 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1