Home |
Search |
Today's Posts |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Sub Test()
Dim iLastrow As Long Dim i As Long iLastrow = Cells(Rows.Count, "A").End(xlUp).Row For i = iLastrow To 2 Step -1 If Cells(i, "B").Value = Cells(i - 1, "B").Value Then Cells(i - 1, "A").Value = Cells(i - 1, "A").Value + _ Cells(i, "A").Value Cells(i, "A").ClearContents End If Next i Range("A1:A" & iLastrow).SpecialCells(xlCellTypeBlanks).EntireRow .Delete End Sub -- HTH RP (remove nothere from the email address if mailing direct) "Scott Wagner" wrote in message ... Looking to clean up product order list of items with a macro. Idea would be that if the part number is the same sum all lines into one and then delete each line other than the sum line. There are presorted by the part number so the like values would be in adjacent rows. Thanks so much! Scott Here is an example of what I have: Qty Part # 4 SG400R 1 TK4V1200R 1 TK4V1200R 6 TNG3 8 TNG3 6 TNG3 2 SKLB36BC1200 1 SKLB36BC1200 1 TCAL125 12 TCAL125 Here is what I'd like to end up with: Qty Part # 4 SG400R 2 TK4V1200R 20 TNG3 3 SKLB36BC1200 13 TCAL125 |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Data Validation in Excel 2000 - Can 2 items from a list be combine | Excel Discussion (Misc queries) | |||
Like items will not combine in a pivot table. | Excel Worksheet Functions | |||
How do I combine quantities of similar line items | Excel Discussion (Misc queries) | |||
How do I combine four data items into one in a Pivot Table? | Excel Discussion (Misc queries) | |||
how to combine items in 3 columns and produce all combinations usi | Excel Programming |