1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23
| Option Explicit
Sub completer_bd()
Dim LastLig As Long, i As Long, j As Long
Dim Tb, Td
With Worksheets("donnees")
LastLig = .Cells(.Rows.Count, "A").End(xlUp).Row
Td = .Range("A2:F" & LastLig)
End With
With Worksheets("bd")
LastLig = .Cells(.Rows.Count, "B").End(xlUp).Row
Tb = .Range("B2:G" & LastLig)
For i = 1 To LastLig - 1
'comment utiliser les tableaux, pour faire comparaison et inscrire appareil en colonne G
If Td(i, 1) = Tb(j, 1) And Td(i, 2) = Tb(j, 2) And Td(i, 3) = Tb(j, 3) And Int(Td(i, 4)) = Int(Tb(j, 4)) Then
Tb(j, 6) = Td(i, 6)
Next i
.Range("C2:G" & LastLig) = Tb
End With
End Sub |
Partager