View Single Post
  #4   Report Post  
Posted to microsoft.public.excel.programming
aileen aileen is offline
external usenet poster
 
Posts: 78
Default Check for Duplicates then Sum cells of duplicates

Acutally, I need to see 16 in the first row, column L and it would be nice to
be able to then delete the second row

"Mike H" wrote:

Hi,

I can see what your code is doing but am not clear about the result you
expect.

take this data

Columns
C D E F K L
7 1 2 3 4 ?
9 1 2 3 4

Mike


What do you expect to see in column L

Mike


"aileen" wrote:

I am checking for duplicates in a workbook. The following is the code I'm
using:

lr = ActiveSheet.Cells(Rows.Count, 1).End(xlUp).Row
For i = lr To 1 Step -1
With ActiveSheet
If Cells(i, 11) = Cells(i + 1, 11) _
And Cells(i, 6) = Cells(i + 1, 6) _
And Cells(i, 4) = Cells(i + 1, 4) _
And Cells(i, 5) = Cells(i + 1, 5) Then
Cells(i, 12) = Cells(i, 3) + Cells(i + 1, 3)
End If
End With
Next

This works if there is only one duplicate entry, but I can have multiple
duplicate entries. I need to sum all of the column C cells for each
duplicate found. Is this possible?