+ Reply to Thread
Results 1 to 3 of 3

How do I consolidate rows with duplicate information in one column but combine data in the

  1. #1
    Registered User
    Join Date
    12-15-2021
    Location
    USA
    MS-Off Ver
    Excel - Microsoft 365
    Posts
    2

    How do I consolidate rows with duplicate information in one column but combine data in the

    I have a spreadsheet of incoming products and the shipping containers they are arriving on. I want to combine rows with duplicate items while preserving the quantities of that item in each container column. For this I've been using the following VBA code:

    Sub combine()

    Dim c As Range
    Dim i As Integer

    For Each c In Range("A2", Cells(Cells.SpecialCells(xlCellTypeLastCell).Row, 1))
    If c = c.Offset(1) And c <> "" Then
    For i = 1 To 15
    If c.Offset(1, i) <> "" Then
    c.Offset(, i) = c.Offset(1, i)
    End If
    Next
    c.Offset(1).EntireRow.Delete
    End If

    Next

    End Sub

    This code works great, however, sometimes these items have multiple rows with quantities in the same container. This code merely replaces the quantity above with the quantity below. I need them to be added.

    Spreadsheet.png
    Last edited by Thatoneguy7215; 12-15-2021 at 07:42 PM. Reason: Solved

  2. #2
    Forum Expert WideBoyDixon's Avatar
    Join Date
    10-03-2016
    Location
    Sheffield, UK
    MS-Off Ver
    365
    Posts
    2,182

    Re: How do I consolidate rows with duplicate information in one column but combine data in

    Small change I think:

    Please Login or Register  to view this content.
    WBD
    Office 365 on Windows 11, looking for rep!

  3. #3
    Registered User
    Join Date
    12-15-2021
    Location
    USA
    MS-Off Ver
    Excel - Microsoft 365
    Posts
    2

    Re: How do I consolidate rows with duplicate information in one column but combine data in

    Amazing! Works like a charm. Thank you!

+ 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. Consolidate Rows Based on Partial Information in Column
    By awiltz in forum Excel Formulas & Functions
    Replies: 4
    Last Post: 06-07-2020, 02:32 PM
  2. Replies: 3
    Last Post: 07-11-2019, 12:53 PM
  3. [SOLVED] Consolidate data in multiple rows and combine it in another worksheet
    By Bubbles_A in forum Excel Programming / VBA / Macros
    Replies: 15
    Last Post: 06-21-2018, 09:21 AM
  4. [SOLVED] How to combine duplicate rows of information with conditions
    By divezaj in forum Excel Programming / VBA / Macros
    Replies: 16
    Last Post: 03-15-2017, 11:14 AM
  5. Combine and Sum data in multiple rows if duplicate exists in 1 column
    By bnasty in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 10-31-2012, 07:11 PM
  6. Help: Consolidate duplicate rows in different tables with one varying column
    By g1987 in forum Access Programming / VBA / Macros
    Replies: 0
    Last Post: 06-19-2012, 02:03 PM
  7. [SOLVED] Help: Consolidate duplicate rows with one varying column
    By g1987 in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 06-19-2012, 12:23 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