http://help.lockergnome.com/office/d...ct1003548.html
above is cross-link to First post. Sorry I didn't find this forum first. I am somewhat green with everything but basic excel.
I have a spreadsheet with columns A through F. Column "C" is an invoice # and is listed multiple times, depending on the number of items billed on this invoice. I'm trying to delete all multiple copies of this invoice leaving only the first instance of each (the first entry has the total sale). I found a macro on a forum from a while back and it will delete my duplicate invoices if I insert my invoice # to Column "A", but it get's my other columns out of sync. I think this macro was written for a two column spreadsheet. Here is the Macro that almost works:
Sub DeleteDupes()
Dim Iloop As Integer
Dim Numrows As Integer
'Turn off warnings, etc.
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Numrows = Range("A65536").End(xlUp).Row
Range("A1:B" & Numrows).Select
Selection.Sort Key1:=Range("A1"), Order1:=xlAscending, _
Key2:=Range("B1"), Order2:=xlAscending, Header:=xlYes, _
OrderCustom:=1, MatchCase:=False, Orientation:=xlTopToBottom
For Iloop = Numrows To 2 Step -1
If Cells(Iloop, "A") + Cells(Iloop, "B") = Cells(Iloop - 1, "A") + _
Cells(Iloop - 1, "B") Then
Rows(Iloop).Delete
End If
Next Iloop
'Turn on warnings, etc.
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
I'm not familiar enough with Macros to know how to adapt this. Any help would be greatly appreciated.
Marv
Bookmarks