Here’s the code I’m using to delete duplicates. This works fine, but the area I’m stuck on is how to code BEFORE I delete the row.
I need to copy data from cells(i, “BE:BG”) and paste (up one row and several columns to the right) to cells(i, “BK:BM”) and THEN use the code below to delete the dup row.
I’ve only been doing this for a month now so I’m at a loss. Would I use Range.Offset? I understand some individual parts of VBA but integrating them is giving me difficulty. I’ve tried different variations and obviously w/ no success since I’m asking for help.
Thanks for your help. Oh using excel 2003
I need to copy data from cells(i, “BE:BG”) and paste (up one row and several columns to the right) to cells(i, “BK:BM”) and THEN use the code below to delete the dup row.
I’ve only been doing this for a month now so I’m at a loss. Would I use Range.Offset? I understand some individual parts of VBA but integrating them is giving me difficulty. I’ve tried different variations and obviously w/ no success since I’m asking for help.
Code:
Sub DeleteDupes()
Dim i As Integer
Workbooks("EmergContacts.xls").Activate
For i = Cells(Rows.Count, "C").End(xlUp).Row To 1 Step -1
If WorksheetFunction.CountIf(Range("C:C"), Cells(i, 3)) > 1 Then
Cells(i, 3).EntireRow.Delete
End If
Next i
End Sub
Thanks for your help. Oh using excel 2003