Bonjour,
Sub PAC()
Dim wso As Worksheet, wsc As Worksheet, cel As Range, rep As String, ligne As Integer, colonne As Integer
Set wso = Sheets("Feuil1")
Set wsc = Sheets("Feuil2")
For i = 2 To wso.[A1].End(xlDown).Row
If wso.Cells(i, 3) = "PA" Then
Set cel = wsc.Columns("A").Find(wso.Cells(i, 1), wsc.Range("A1").End(xlDown), xlValues, xlWhole)
If cel Is Nothing Then
wsc.Cells(wsc.Cells(Application.Rows.Count, 1).End(xlUp).Row + 1, 1) = wso.Cells(i, 1)
End If
ElseIf wso.Cells(i, 3) = "PAC" Then
Set cel = wsc.Columns("A").Find(wso.Cells(i, 2), wsc.Range("A1").End(xlDown), xlValues, xlWhole)
If cel Is Nothing Then
ligne = wsc.Cells(Application.Rows.Count, 1).End(xlUp).Row + 1
wsc.Cells(ligne, 1) = wso.Cells(i, 2)
Else
ligne = cel.Row
End If
colonne = wsc.Cells(ligne, Application.Columns.Count).End(xlToLeft).Column + 1
wsc.Cells(ligne, colonne) = wso.Cells(i, 1)
End If
Next
End Sub