Perhaps try
Note: There is some spaces in column "CustomerNumber" they are removed in the macro
Option Explicit
Sub Treat()
Dim DataDic As Object
Set DataDic = CreateObject("Scripting.Dictionary")
Dim LR As Integer, I As Integer, II As Integer, FR As Integer
Const CustNbCol As String = "B"
Const SiteNamCol As String = "E"
Const Add1Col As String = "F"
Const Add2Col As String = "G"
Const SiteIdCol As String = "C"
Const ShipToCodCol As String = "D"
Dim Temp
Dim DelRg As Range
FR = 2
LR = Cells(Rows.Count, CustNbCol).End(3).Row
With DataDic
For I = LR To FR Step -1
Temp = Trim(Cells(I, CustNbCol)) & "/" & Cells(I, SiteNamCol) & "/" & Cells(I, Add1Col) & "/" & Cells(I, Add2Col)
If (.exists(Temp)) Then
II = .Item(Temp)
If (Cells(I, SiteIdCol) = "") Then Cells(I, SiteIdCol) = Cells(II, SiteIdCol)
If (Cells(I, ShipToCodCol) = "") Then Cells(I, ShipToCodCol) = Cells(II, ShipToCodCol)
Cells(II - 1, 1).ListObject.ListRows(II - 1).Delete
End If
.Item(Temp) = I
Next I
End With
End Sub
Bookmarks