Sub SupprimerReferences()
Dim c As Range
Dim ref As Long
Dim Client As String, Adr1 As String
Dim plgToDelete As Range 'contiendra toutes les cellules à supprimer = Ref et Client en fin de macro
With Sheets("Feuil1")
ref = .Range("I12")
Client = .Range("I11")
With .Range("8:8")
Set c = .Find(What:=ref, After:=.Cells(1, 1), LookIn:=xlValues, SearchOrder:=xlByColumns)
If Not c Is Nothing Then
Adr1 = c.Address
Do
'si la cellule au-dessus est = au client alors on supprime en décalant
If c(0, 1) = Client Then
If plgToDelete Is Nothing Then
Set plgToDelete = c(0, 1).Resize(2)
Else
Set plgToDelete = Union(plgToDelete, c(0, 1).Resize(2))
End If
End If
Set c = .FindNext(c)
Loop While c.Address <> Adr1 And Not c Is Nothing
End If
End With
End With
If Not plgToDelete Is Nothing Then plgToDelete.Delete xlShiftToLeft
End Sub