1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
| Dim rep As String
rep = InputBox("QUEL FRS", "Fournisseur à sélectionner") & "*"
With Sheets("Base (2)").Range("b2")
.AutoFilter field:=2, Criteria1:="<>" & rep
End With
Dim nbl As Long
Dim nbl2 As Long
nbl = Sheets("Etude").Cells(Application.Rows.Count, 2).End(xlUp).Row 'compte le nombre ligne
nbl2 = Sheets("Base (2)").Cells(Application.Rows.Count, 2).End(xlUp).Row 'compte le nombre de ligne
For a = 1 To nbl
For b = 1 To nbl2
If Sheets("Etude").Cells(a, 7) = Sheets("Base (2)").Cells(b, 2) Then
Sheets("Etude").Cells(a, 8) = Sheets("Base (2)").Cells(b, 15)
End If
If Sheets("Etude").Cells(a, 7) = Sheets("Base (2)").Cells(b, 2) Then
Sheets("Etude").Cells(a, 9) = Sheets("Base (2)").Cells(b, 16)
End If
Next
Next |
Partager