Eliminate Duplicate Rows - Add columns Accordingly

M

meendar

Hi anyone helpme to sort out this problem.

I have an Excel sheet with names in Column A, Hours in Column B and
Amount in Column C. What my question is i want to eliminate the
duplicate rows in Column A , mean while B and C should be added to the
unique user row. Is there any macro for that?

Thanks in Advance.
 
B

Bob Phillips

Sub CreateSummary()
Dim iLastRow As Long
Dim i As Long
Dim iRow As Long

iLastRow = Cells(Rows.Count, "A").End(xlUp).Row
For i = iLastRow To 2 Step -1
iRow = Application.Match(Cells(i, "A").Value, Columns(1), 0)
If iRow < i Then
Cells(iRow, "B").Value = Cells(iRow, "B").Value + Cells(i,
"B").Value
Cells(iRow, "C").Value = Cells(iRow, "C").Value + Cells(i,
"C").Value
Rows(i).Delete
End If
Next i

End Sub


--
HTH

Bob Phillips

(remove nothere from email address if mailing direct)
 

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

Top