+ Reply to Thread
Results 1 to 5 of 5

Column of Text - combining terms

  1. #1
    Registered User
    Join Date
    02-11-2007
    Posts
    4

    Column of Text - combining terms

    I have a column of text - stock symbols. How do I convert this column to a single line of text with each symbol seperated by a comma? I need to be able to copy this line to a text document. Thanks.

  2. #2
    Valued Forum Contributor mudraker's Avatar
    Join Date
    11-10-2003
    Location
    Melbourne, Australia
    Posts
    3,983
    You will get a better response if you list a sample of the data

  3. #3
    Registered User
    Join Date
    02-11-2007
    Posts
    4
    Clarification.

    Example:

    Column of Stock Symbols

    ICE
    ATHR
    LVS
    RIMM
    AAPL


    How do I convert to:

    ICE,ATHR,LVS,RIMM,AAPL



    Thanks

  4. #4
    Forum Expert Paul's Avatar
    Join Date
    02-05-2007
    Location
    Wisconsin
    MS-Off Ver
    2016/365
    Posts
    6,885
    Try this on for size:

    Open VBA (ALT+F11), right-click on your VBAProject for the current workbook (e.g. "VBAProject (Book1)") and choose Insert -- Module.

    Paste the following code into the new Module (or current module if you already have one):

    Please Login or Register  to view this content.
    Close VBA, and you're all set to use this UDF in your worksheet. Usage as follows:

    In any cell, type: =CONCAT(range,"optional delimiter")

    For example, =CONCAT(A1:A100,",")

    This will concatenate all cells from A1 to A100 and insert a comma in between each entry. If you want a comma then a space, just change the delimiter to ", " (The delimiter must be in quotation marks!)

    Hope that helps.
    Last edited by Paul; 02-11-2007 at 07:50 PM.

  5. #5
    Registered User
    Join Date
    02-11-2007
    Posts
    4
    Thanks Paul. I'll give it a try.

+ 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