Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Summarizing doubles
I have a rather lengthy list of products sold by the company I work for; one
column with the product name, one column with the number of articles sold. There are many instances where the same product appears on several rows. I am looking for a way to remove the doubles in the first column, but summarize the different values in the second column into one. How? |
#2
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
Summarizing doubles
Sub TidyUp()
Dim LastRow As Long Dim pos As Long Dim i As Long With ActiveSheet LastRow = .Cells(.Rows.Count, "A").End(xlUp).Row For i = LastRow To 3 Step -1 pos = 0 On Error Resume Next pos = Application.Match(.Cells(i, "A").Value, ..Range("A1").Resize(i - 1), 0) On Error GoTo 0 If pos 0 Then .Cells(pos, "B").Value = .Cells(pos, "B").Value + .Cells(i, "B").Value .Rows(i).Delete End If Next i End With End Sub -- --- HTH Bob (there's no email, no snail mail, but somewhere should be gmail in my addy) "Sippan" wrote in message ... I have a rather lengthy list of products sold by the company I work for; one column with the product name, one column with the number of articles sold. There are many instances where the same product appears on several rows. I am looking for a way to remove the doubles in the first column, but summarize the different values in the second column into one. How? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Sorting doubles | Excel Discussion (Misc queries) | |||
Complex Formula to Find Doubles | Excel Worksheet Functions | |||
Cell height doubles after paste | Excel Discussion (Misc queries) | |||
How do I set up a Doubles Tennis roster for 12 players? | New Users to Excel | |||
Summarizing data | Excel Discussion (Misc queries) |