+ Reply to Thread
Results 1 to 3 of 3

Thread: How to quickly concatenate a column containing 7 items with a column of 200 items?

  1. #1
    Registered User
    Join Date
    03-09-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    2

    How to quickly concatenate a column containing 7 items with a column of 200 items?

    How can I quickly concatenate a column containing 7 items with a column of 200 items? Currently, I'm just manually retyping the formula when it completes a cycle of 7, but there's gotta be a faster way.

    Thanks.

  2. #2
    Forum Moderator zbor's Avatar
    Join Date
    02-10-2009
    Location
    Croatia
    MS-Off Ver
    Excel 2007
    Posts
    6,225

    Re: How to quickly concatenate a column containing 7 items with a column of 200 items

    Maybe this will help:


    merge contents of a row of data into one cell separated by a comma

    Make a User Defined Function

    Function ConcatRow(Rng As Range, Optional Separator As String)
        Dim r As Integer, c As Integer
        Dim StartCol As Integer, EndCol As Integer
        
        With Rng
            r = .Row
            StartCol = .Column
            EndCol = .End(xlToRight).Column
        End With
        
        For c = StartCol To EndCol
            ConcatRow = ConcatRow & Cells(r, c) & Separator
        Next
        ConcatRow = Left(ConcatRow, Len(ConcatRow) - 1)
    End Function
    "Relax. What is mind? No matter. What is matter? Never mind!"

  3. #3
    Registered User
    Join Date
    03-09-2011
    Location
    Atlanta, GA
    MS-Off Ver
    Excel 2007
    Posts
    2

    Re: How to quickly concatenate a column containing 7 items with a column of 200 items

    That's more code than I've ever done before, but I'll give it a shot. Thank you so much.

    I probably should have mentioned that the data is actually text.

+ 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.2.0