If your date in A and B Column then Try it Sub RemoveDuplicate() Dim rng As Range Dim cell As Range Set rng = Range("A2:A" & ActiveSheet.UsedRange.Rows.Count) For Each cell In rng If WorksheetFunction.CountIf(rng, cell.Value) > 1 Then cell.EntireRow.Delete End If Next
Range("B" & Range("B10000").End(xlUp).Row + 1).Formula = "=Sum(B2:B" & Range("B10000").End(xlUp).Row & ")" End Sub -----Original Message----- From: excel-macros@googlegroups.com [mailto:excel-macros@googlegroups.com] On Behalf Of Raghavendra Sent: Thursday, July 21, 2011 10:49 PM To: MS EXCEL AND VBA MACROS Subject: $$Excel-Macros$$ VBA - Remove duplicate and get sums Hi, Can anyone let me know VBA code for the below? Input Data Names Amount A 100 B 200 C 100 B 100 A 100 D 150 Out put data should be Names Amount A 200 B 300 C 100 D 150 Regards, Raghavendra -- ---------------------------------------------------------------------------- ------ Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel -- ---------------------------------------------------------------------------------- Some important links for excel users: 1. Follow us on TWITTER for tips tricks and links : http://twitter.com/exceldailytip 2. Join our LinkedIN group @ http://www.linkedin.com/groups?gid=1871310 3. Excel tutorials at http://www.excel-macros.blogspot.com 4. Learn VBA Macros at http://www.quickvba.blogspot.com 5. Excel Tips and Tricks at http://exceldailytip.blogspot.com To post to this group, send email to excel-macros@googlegroups.com <><><><><><><><><><><><><><><><><><><><><><> Like our page on facebook , Just follow below link http://www.facebook.com/discussexcel