+ Reply to Thread
Results 1 to 11 of 11

Excel 2007 : Combining Numerous Data From Many Cells Into One Cell

  1. #1
    Registered User
    Join Date
    08-05-2009
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2007
    Posts
    70

    Combining Numerous Data From Many Cells Into One Cell

    Hi,

    I have some customer number data, whereas each customer number is in it's own cell. I want to combine all the customer numbers into one cell, with each number seperated by a comma.

    I know I can use the =A1&","&A2 thing, but there's 25+ numbers to combine.

    All numbers are 6 digits long.

    Is there an easier way to do this, say with the Concantenate Function?

    Sample spreadsheet attached.

    Thanks
    Rick
    Attached Files Attached Files
    Last edited by Rick K; 10-29-2010 at 12:50 PM.

  2. #2
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining Numerous Data From Many Cells Into One Cell

    Concatenate will be for all intents and purposes, just as tedious to enter initially.

    Excel doesn't have a concatenate range function but if a UDF is allowable you could try this
    Please Login or Register  to view this content.

    Enter as this, to accept the default delimiter (", ")
    Please Login or Register  to view this content.

    or e.g.
    Please Login or Register  to view this content.
    to use a different delimiter

    Hope this helps
    Attached Files Attached Files
    If you need any more information, please feel free to ask.

    However,If this takes care of your needs, please select Thread Tools from menu above and set this topic to SOLVED. It helps everybody! ....

    Also
    اس کی مدد کرتا ہے اگر
    شکریہ کہنے کے لئے سٹار کلک کریں
    If you are satisfied by any members response to your problem please consider using the small Star icon bottom left of their post to show your appreciation.

  3. #3
    Registered User
    Join Date
    08-05-2009
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Combining Numerous Data From Many Cells Into One Cell

    Thank you. It looks like it will work perfectly, but I need to figure out how to put this into my spreadsheet. Not a power user, but I'll certainly figure it out!

    Thanks again, this has saved me a ton of work.
    Rick

  4. #4
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining Numerous Data From Many Cells Into One Cell

    To use the Function

    1/. With Excel open Press Alt+f11 this will open the VBa Editor.
    2/. In the VBa editor Insert > Module
    3/. Paste all of the above code in the resultant pane/window.
    4/. Save and close the VBa Editor.

    Then follow the instructions in Post #2

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

    Re: Combining Numerous Data From Many Cells Into One Cell

    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 as a macro-enabled workbook

    The function is installed and ready to use as shown above originally.
    _________________
    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!)

  6. #6
    Registered User
    Join Date
    08-05-2009
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Combining Numerous Data From Many Cells Into One Cell

    Thank you; the knowledge here never ceases to amaze me. This works like a charm. This whole thing is used to retreive data from our system. You can enter account numbers, but only if they're seperated by a comma. Having to enter account numbers into our system manually is a collosal pain in the neck. This method cuts the process time down to nothing!

    Rick

  7. #7
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining Numerous Data From Many Cells Into One Cell

    Happy to have been of some help.

  8. #8
    Registered User
    Join Date
    08-05-2009
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Combining Numerous Data From Many Cells Into One Cell

    Good Morning,
    I've been using this solution for about a year now, and everything's been great! Tried this morning, and my code appears to be intact, but excel is acting like it doesn't recognize anything.

    So, I opened a new module, inserted the code again, and nothing. I'm getting a "#NAME? error, and also an "ambiguous name" message.

    Any ideas?

    Thanks
    Rick


    Quote Originally Posted by Marcol View Post
    Concatenate will be for all intents and purposes, just as tedious to enter initially.

    Excel doesn't have a concatenate range function but if a UDF is allowable you could try this
    Please Login or Register  to view this content.

    Enter as this, to accept the default delimiter (", ")
    Please Login or Register  to view this content.

    or e.g.
    Please Login or Register  to view this content.
    to use a different delimiter

    Hope this helps
    Last edited by Rick K; 10-06-2011 at 10:16 AM.

  9. #9
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining Numerous Data From Many Cells Into One Cell

    1/. Did you enable macros when you opened the workbook? It can be easy to hit the wrong button when you are in a hurry.

    2/. If you added a new module and re-entered the code you will get an "ambiguous name" message, unless you deleted the old code.
    This is because you have two function with the same name, it doesn't matter that they are in different modules.

  10. #10
    Registered User
    Join Date
    08-05-2009
    Location
    Buffalo, NY
    MS-Off Ver
    Excel 2007
    Posts
    70

    Re: Combining Numerous Data From Many Cells Into One Cell

    Thought of that one... Macros are enabled, along with everything else I could think of... I'll delete that duplicate code and that should remedy the other error message. Also, after rebooting my pc, everything seems to be working ok now. Hmmmmmmmm.

    Thanks for the reply, and lets hope this fixes things...

  11. #11
    Forum Guru (RIP) Marcol's Avatar
    Join Date
    12-23-2009
    Location
    Fife, Scotland
    MS-Off Ver
    Excel '97 & 2003/7
    Posts
    7,216

    Re: Combining Numerous Data From Many Cells Into One Cell

    Excel can get itself in a tangle from time to time, usually closing Excel then reopening is enough to cure it.
    If you had to reboot then probably the OS didn't load Excel properly, this can happen when your hard disc is running at over 70%-80% used.

+ Reply to 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