+ Reply to Thread
Results 1 to 5 of 5

Output selection to a single string

  1. #1
    Registered User
    Join Date
    12-17-2008
    Location
    Malaysia
    Posts
    12

    Output selection to a single string

    I have multiple rows containing list of serials as below.

    A2004 / A2018 / A2038 / A2122 / A2166

    I would like to format these serials in such that they are concatenated into a single string with each serials separated by a comma and the results shall be positioned at the last column of each row. Also the string must have an (M&E) text at the end. So the result should look like this.

    A2004, A2018, A2038, A2122, A2166 (M&E)

    Below is the code for input from a single column instead of rows. How do I tweak to get my desired result.

    Please Login or Register  to view this content.

  2. #2
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Output selection to a single string

    It looks like you can just add to your final "a" string...

    a = Left(a, Len(a) - 1) & " (M&E)"

  3. #3
    Registered User
    Join Date
    12-17-2008
    Location
    Malaysia
    Posts
    12

    Re: Output selection to a single string

    Hi Chance 2. Thanks for your reply. I'm relatively new to VBA and will need further explanation. I would like to have a button to perform the task and input the results in Column K of my attachment. Kindly help.
    Attached Files Attached Files

  4. #4
    Forum Contributor
    Join Date
    04-01-2009
    Location
    Irvine, CA
    MS-Off Ver
    Excel 2010
    Posts
    280

    Re: Output selection to a single string

    This code will add the data to column K

    Please Login or Register  to view this content.

  5. #5
    Registered User
    Join Date
    12-17-2008
    Location
    Malaysia
    Posts
    12

    Re: Output selection to a single string

    Thanks Chance2. Made some tweaks and works like a charm.

+ 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