Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 1
Default 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   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 10,593
Default 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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Sorting doubles rbrunz Excel Discussion (Misc queries) 1 June 13th 08 04:20 PM
Complex Formula to Find Doubles Spike9458 Excel Worksheet Functions 7 January 31st 06 12:53 AM
Cell height doubles after paste PBlake Excel Discussion (Misc queries) 1 October 29th 05 07:57 PM
How do I set up a Doubles Tennis roster for 12 players? AliJax New Users to Excel 3 September 17th 05 12:31 AM
Summarizing data Gary Fuller Excel Discussion (Misc queries) 1 November 26th 04 04:17 PM


All times are GMT +1. The time now is 08:00 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"