Closed Thread
Results 1 to 5 of 5

how to combine cell data for a range of cells

  1. #1
    Registered User
    Join Date
    08-12-2009
    Location
    USA
    MS-Off Ver
    Excel 2003
    Posts
    1

    how to combine cell data for a range of cells

    I'm trying to combine cell data for a range of cells. I can not use =A1&" "&b1&" "&c1& because I have too many to enter individually. Is there a way to do this for a range?

    Thanks in advance for your help

  2. #2
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: how to combine cell data for a range of cells

    Not with native functions, no, I'm afraid not.

    Laurent Longre's morefunc.xll add-in provides the MCONCAT function which can concatenate ranges - else you're looking at building your own UDF (VBA).

    (for download of morefunc see: http://download.cnet.com/Morefunc/30...-10423159.html)

  3. #3
    Forum Expert JBeaucaire's Avatar
    Join Date
    03-21-2004
    Location
    Bakersfield, CA
    MS-Off Ver
    2010, 2016, Office 365
    Posts
    33,492

    Re: how to combine cell data for a range of cells

    MoreFunc is excellent, but it's a big ADDIN. If you're only interested in the String Concatenation capability, as Don indicated a UDF would be the way to go.

    Here's a VERY simple one, that string concatenates a range with no criteria:
    Please Login or Register  to view this content.
    How to install the User Defined Function:

    1. Open up your workbook
    2. Get into VB Editor (Press Alt+F11)
    3. Insert a new module (Insert > Module)
    4. Copy and Paste in your code (given above)
    5. Get out of VBA (Press Alt+Q)
    6. Save your sheet

    The function is installed and ready to use. To use as a function, just enter something like this:

    =CONCATRANGE(A1:C1, ",")


    The first parameter is the range, the second parameter is the delimiter you want to use.
    Last edited by JBeaucaire; 08-12-2009 at 03:09 PM.
    _________________
    Microsoft MVP 2010 - Excel
    Visit: Jerry Beaucaire's Excel Files & Macros

    If you've been given good help, use the icon below to give reputation feedback, it is appreciated.
    Always put your code between code tags. [CODE] your code here [/CODE]

    ?None of us is as good as all of us? - Ray Kroc
    ?Actually, I *am* a rocket scientist.? - JB (little ones count!)

  4. #4
    Forum Guru DonkeyOte's Avatar
    Join Date
    10-22-2008
    Location
    Northumberland, UK
    MS-Off Ver
    O365
    Posts
    21,531

    Re: how to combine cell data for a range of cells

    Another approach might be the below which avoids iteration on cell by cell basis (assumes all values are to be used):

    Please Login or Register  to view this content.
    Called say as:

    =CONCATSTR(A1:A10,",")
    =CONCATSTR(A1:B20,".")
    etc

    If it needs to be non-contiguous ranges you could consider using a ParamArray.

    NOTE: the cell by cell approach obviously offers more flexibility long-term if there are certain requirements to be taken into account when reviewing the values themselves prior to adding to the concatenation...

  5. #5
    Registered User
    Join Date
    02-04-2010
    Location
    Sand Springs, OK
    MS-Off Ver
    Excel 2007
    Posts
    1

    Re: how to combine cell data for a range of cells

    This is EXACTLY what I was looking for! Both solutions work very well!

    Thank you for being there!!!!!

    Terry D

Closed Thread

Thread Information

Users Browsing this Thread

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

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