Sum duplicates unique values and delete dupliques

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

my problem is that I have a list with duplicate entries and values attached
to them like this:

col a col b
12 2
12 3
14 5

I'm searching for a macro that would turn my list into this:

col a col b
12 5
14 5

Or like this:

col a col b col c
12 2 3
14 5

So if you could please help me, I would be very grateful!

Please respond also to my email (e-mail address removed) because I have had
problems entering the community and finding spicific threads.

-Dave
 
I prefer the latter

Public Sub ProcessData()
Dim i As Long
Dim iLastRow As Long

With ActiveSheet

iLastRow = .Cells(.Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
If .Cells(i, "A").Value = .Cells(i - 1, "A").Value Then
.Cells(i, "B").Resize(, _
.Cells(i, .Columns.Count).End(xlToLeft).Column - 1).Copy
..Cells(i - 1, "C")
.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)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top