+ Reply to Thread
Results 1 to 3 of 3

How to combine similar column cell and paste the corresponding data to another cell?

Hybrid View

  1. #1
    Registered User
    Join Date
    01-14-2016
    Location
    India
    MS-Off Ver
    Office 2007
    Posts
    5

    Red face How to combine similar column cell and paste the corresponding data to another cell?

    Hi Team,

    I need a help with an excel issue that I have. I want to know how to combine similar cells in a columns and paste the corresponding column data separated by a coma to a separate cell in Excel. I have a sample file attached to this thread. Please help.
    Attached Files Attached Files

  2. #2
    Forum Expert
    Join Date
    03-23-2004
    Location
    London, England
    MS-Off Ver
    Excel 2019
    Posts
    7,065

    Re: How to combine similar column cell and paste the corresponding data to another cell?

    VBA solution looks best


    Sub similaritems()
    lastrow = Worksheets("Sheet1").Cells(Rows.Count, "B").End(xlUp).Row
    k = 3
    j = ""
    For i = 3 To lastrow + 1
    Debug.Print i
    If Cells(i, 1) <> "" Or i = lastrow + 1 Then
        If j <> "" Then
            Cells(k, 7) = j
            l = Left(l, Len(l) - 1)
            Cells(k, 8) = l
            k = k + 1
        End If
        j = Cells(i, 1)
        l = Cells(i, 2) & ", "
    Else
        l = l & Cells(i, 2) & ","
    End If
    Next i
    End Sub
    Regards
    Special-K

    Ensure you describe your problem clearly, I have little time available to solve these problems and do not appreciate numerous changes to them.

  3. #3
    Registered User
    Join Date
    01-14-2016
    Location
    India
    MS-Off Ver
    Office 2007
    Posts
    5

    Re: How to combine similar column cell and paste the corresponding data to another cell?

    Hello Special-K,

    I guess you had taken me wrong, I have given my equirement in the excel. In the excel I had given an example with Column A&B and the final out come should be Column G&H. I have to do this for around 1890 rows. Kindly help me in resolving this.

    Thanks,
    Rakesh.

+ Reply to Thread

Thread Information

Users Browsing this Thread

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

Similar Threads

  1. Sorting of similar cell info must transpose like-data from column to row
    By kcarth in forum Excel Programming / VBA / Macros
    Replies: 10
    Last Post: 06-30-2015, 07:39 AM
  2. Combine each cell of a column into a single cell, separated by commas
    By protcg in forum Excel Formulas & Functions
    Replies: 3
    Last Post: 05-27-2015, 05:12 PM
  3. Replies: 4
    Last Post: 09-26-2013, 04:15 PM
  4. Replies: 7
    Last Post: 10-23-2012, 02:29 PM
  5. Replies: 4
    Last Post: 01-12-2012, 12:30 AM
  6. Combine rows with similar values in one column.
    By sgtpepper in forum Excel General
    Replies: 1
    Last Post: 12-06-2011, 09:31 PM
  7. Combine rows with similar values in one column.
    By sgtpepper in forum Excel General
    Replies: 3
    Last Post: 12-06-2011, 01:43 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