+ Reply to Thread
Results 1 to 15 of 15

Combine rows with same values and merge the values of other columns

  1. #1
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Combine rows with same values and merge the values of other columns

    i need some body to support brothers request i want Combine rows with same values and merge the values of other columns

    As shown in the screenshot below, this is a sales table containing customers and their corresponding orders in different columns. You can see in the table that the same customer made multiple purchases. Our goal is to merge the purchases of the same customer into one row, separate by commas.

    Noted multi lines check

  2. #2
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,212

    Re: Combine rows with same values and merge the values of other columns

    No screenshot but these are of no practical use so please see yellow banner at top of the page on how to attach a sample workbook.
    If that takes care of your original question, please select Thread Tools from the menu link above and mark this thread as SOLVED.

  3. #3
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    i cannot post photos but i will example you as below

    ulmapackaging.com Chorizo vacuum packaging in thermoforming in flexible film — ULMA Packaging
    ulmapackaging.com L sealer shrink machine SL 300 Totally automatic "L" sealer machine with or without shrinking tunnel. Designed for any kind of product packaging with shrink films as well as not shrink films.
    ulmapackaging.com 12 grapes packaging in traysealing in modifed atmosphere (MAP) in rigid trays — ULMA Packaging
    ulmapackaging.com 4 potatoes packaging in gusseted pack with laminated film. — ULMA Packaging High speed. Continuous motion machine at 100 pack/min.
    ulmapackaging.com 5 crackers stacked packaging in flow pack wrapper — ULMA Packaging
    ulmapackaging.com 5 Kg Chocolate Bars packaging in flow pack wrapper (HFFS) — ULMA Packaging Superb presentation for distribution to chocolate processing companies
    ulmapackaging.com A turnkey solution for Quesos Entrepinares — ULMA Packaging At the Quesos Entrepinares plant, ULMA Packaging has achieved the full integration of the logistics and packaging system together with Ulma Handling to offer the client a turnkey solution.
    ulmapackaging.com About us — ULMA Packaging ULMA Packaging, specialised in the design and production of packaging equipment and services.
    ulmapackaging.com Adaptations and spare parts — ULMA Packaging Every part helps bring success
    ulmapackaging.com Africa & Middle East — ULMA Packaging
    ulmapackaging.com Agrodanieli opts for ULMA Packaging to incorporate stateoftheart packaging solutions for the new products it is launching onto the market — ULMA Packaging This regional leading company in the Brazilian agrifood industry has incorporated the new FS 400 horizontal flow pack wrapping machine for meat and poultry products on trays for the new product it is launching: the first chicken with Omega3 in Brazil.
    ulmapackaging.com Algeria — ULMA Packaging
    ulmapackaging.com Alternative materials — ULMA Packaging Paper, monomaterial or compostable films.
    ulmapackaging.com Anchovies in oil packaging in thermoforming with rigid film bipack — ULMA Packaging
    ulmapackaging.com Anchovies with oil MAP packaging in thermoforming in rigid film — ULMA Packaging
    ulmapackaging.com Anchovy fillets in brine packaging in traysealing — ULMA Packaging
    ulmapackaging.com Anchovy oil packaging in traysealing in modified atmosphere (MAP) in rigid trays — ULMA Packaging
    ulmapackaging.com Anoscope packaging in thermoforming with flexible film — ULMA Packaging

    ulmapackaging.com and all data as above in one cell

    Thanks for your support

  4. #4
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,212

    Re: Combine rows with same values and merge the values of other columns

    Still no use: we need an Excel workbook!

  5. #5
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    please check attached
    Attached Files Attached Files

  6. #6
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    pls check attached
    Attached Files Attached Files

  7. #7
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,212

    Re: Combine rows with same values and merge the values of other columns

    Our goal is to merge the purchases of the same customer into one row, separate by commas.
    so for "ulmapackaging.com" you want over 1000 rows into ONE cell ??? Why ? Or do you really mean one entry per column?

    For a start, cell has limit of 32767 characters which you easily exceed.

  8. #8
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    i want to merge all columns for "ulmapackaging.com" into one cell but you told me that cell has a limit of 32767 characters. Correct

    can spilt 1000 row to 2 or 3 column according to limit , i hope you can understand me

  9. #9
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Combine rows with same values and merge the values of other columns

    This code limit characters count in each cell is 1000, change upto 32000
    limit = 1000

    PHP Code: 
    Option Explicit
    Sub combiAll
    ()
    Dim lr&, i&, count&, k&, c&, lim&, rngres()
    Dim dic As Objectkey
    Set dic 
    CreateObject("Scripting.Dictionary")
    lim 1000 ' set characters limitation for each cell (up to 32000)
    rng = Sheets("all domain").Range("A2").CurrentRegion.Value
    For i = 2 To UBound(rng)
        If Not dic.exists(rng(i, 1)) Then dic.Add rng(i, 1), ""
    Next
    ReDim res(1 To dic.count, 1 To 1000)
    For Each key In dic.keys
        k = k + 1: res(k, 1) = key: c = 2
        For i = 2 To UBound(rng)
            If rng(i, 1) = key Then
                count = Len(res(k, c)) + Len(rng(i, 2)) + 1
                If count > lim Then c = c + 1
                res(k, c) = res(k, c) & rng(i, 2) & vbLf
            End If
        Next
    Next
    With Sheets("Combine row")
        .Range("A2:ZZ10000").Clear
        .Range("A2").Resize(dic.count, 1000).Value = res
        .Range("A1:ZZ1").EntireColumn.AutoFit
        .Range("A1:A1000").EntireRow.VerticalAlignment = xlCenter
    End With
    End Sub 
    Attached Files Attached Files
    Quang PT

  10. #10
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    really thanks really

  11. #11
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    Hello brother,

    please support me in the Excel with vba Function

    you will find Inside excel two sheets the first sheet is called Name Domain, in sheet Domain includes two columns Url and Description, and the second sheet is called Target keywords

    What I need is below
    I will put my target keyword list in column A in Target keywords containing three words, not 1 word, I want to change the cell color in the description in the domain sheet for each cell if it contains one of several values based on Target Keywords
    Attached Files Attached Files

  12. #12
    Forum Expert bebo021999's Avatar
    Join Date
    07-22-2011
    Location
    Vietnam
    MS-Off Ver
    Excel 2016
    Posts
    9,466

    Re: Combine rows with same values and merge the values of other columns

    Can you color a specific cell MANUALLY that meets the criteria and explain why?

  13. #13
    Forum Expert
    Join Date
    05-05-2015
    Location
    UK
    MS-Off Ver
    Microsoft Excel for Microsoft 365 MSO (Version 2402 Build 16.0.17328.20068) 64-bit
    Posts
    28,212

    Re: Combine rows with same values and merge the values of other columns

    Please Login or Register  to view this content.
    Column C has an "X" to allow filtering of results
    Attached Files Attached Files
    Last edited by JohnTopley; 10-12-2023 at 04:37 AM.

  14. #14
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    regards brother to you, i do not have any words to say to you without really thanks

  15. #15
    Registered User
    Join Date
    10-08-2023
    Location
    egypt
    MS-Off Ver
    2010
    Posts
    35

    Re: Combine rows with same values and merge the values of other columns

    Hello brother bebo021999 when i run excel vba i found this error in this line
    count = Len(res(k, c)) + Len(rng(i, 2)) + 1



    Please Login or Register  to view this content.
    Attached Images Attached Images
    Last edited by mohamedabdo; 11-01-2023 at 11:02 AM. Reason: i will attached photos

+ 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. Indicate Duplicate Rows/Combine them/Sum Values/Results in Separate Columns
    By chancw in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 04-09-2022, 03:28 AM
  2. Replies: 2
    Last Post: 03-05-2018, 12:08 PM
  3. [SOLVED] Need a Macro to Transpose and Combine like Values from rows to columns
    By Isara-NJ in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 04-27-2017, 08:38 AM
  4. [SOLVED] Combine rows with duplicate items in one cell and merge values in other cell
    By Niclal in forum Excel Programming / VBA / Macros
    Replies: 17
    Last Post: 09-18-2014, 07:04 AM
  5. Combine rows with duplicate values into separate columns
    By itgeekgroup in forum Excel Programming / VBA / Macros
    Replies: 8
    Last Post: 03-18-2014, 11:12 AM
  6. Merge Duplicate Rows unique values into single rows for an infinite amount of columns/rows
    By aimeecrystalaid in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 08-21-2013, 08:43 PM

Tags for this Thread

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