Results 1 to 16 of 16

After concatenateing need to get rid of last comma

Threaded View

  1. #1
    Registered User
    Join Date
    06-22-2014
    Location
    brooklyn,ny
    MS-Off Ver
    2010
    Posts
    9

    After concatenateing need to get rid of last comma

    We have 8 columns. The amount of cells with data in it varies anywhere from one cell to all 8 cells. We would like to combine the data in all 8 with a comma and space in between each one but no commas for those cells that don't have data. We also would like to add an "&" before the last one (replacing the comma).

    We used this VBA to add the commas to the end of each individual cell:

    Sub AppendToExistingOnRight()
    Dim c as range
    For each c in Selection
    If c.value <> "" Then c.value = c.value & ","
    Next
    End Sub
    We then did concatenate for all 8 cells which pulled it all together into one. We are stuck at how to get rid of the last comma (at the end) and how to replace the second to last comma with the &.

    Right now it comes out something like this:

    Data 1, Data 2, Data 3, Data 4, Data 5, Data 6, Data 7, Data 8,

    We would like it:

    Data 1, Data 2, Data 3, Data 4, Data 5, Data 6, Data 7 & Data 8

    We would appreciate help with this
    Last edited by needurhelp; 06-22-2014 at 11:11 PM.

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. [SOLVED] Finishing an VBA program
    By Nuno Neves in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 03-14-2014, 11:56 AM
  2. Need Help Finishing My Sheet
    By Adam Schaefer in forum Excel Formulas & Functions
    Replies: 7
    Last Post: 11-18-2013, 10:02 PM
  3. [SOLVED] I need help with finishing a macro.
    By ATOP in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 10-14-2013, 11:38 AM
  4. [SOLVED] Loop not finishing
    By boomersooner5136 in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 08-14-2012, 10:51 AM
  5. macro not finishing task
    By erock24 in forum Excel Programming / VBA / Macros
    Replies: 7
    Last Post: 11-29-2007, 07:32 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