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 29 30 31 32 33 34 35 36 37 38 39
| Option Explicit
Sub Vérif_pl()
Dim wsSrc As Worksheet
Dim wsDest As Worksheet
Set wsSrc = Sheets("Status Report")
Set wsDest = Sheets("Deploiement")
Dim LastLine As Long
Dim dstCol1 As Variant
Dim dstCol2 As Variant
LastLine = wsDest.Range("c" & Rows.Count).End(xlUp).Row
dstCol1 = wsDest.Range("C1:C" & LastLine)
dstCol2 = wsDest.Range("J1:J" & LastLine)
Dim srcCol1 As Variant
Dim srcCol2 As Variant
LastLine = wsSrc.Range("G" & Rows.Count).End(xlUp).Row
srcCol1 = wsSrc.Range("G1:G" & LastLine)
srcCol2 = wsSrc.Range("AA1:AA" & LastLine)
Dim lisrc As Long
Dim lidst As Long
For lidst = 1 To UBound(dstCol1, 1)
For lisrc = 1 To UBound(srcCol1, 1)
If (srcCol1(lisrc, 1) = dstCol1(lidst, 1)) And (srcCol2(lisrc, 1) = dstCol2(lidst, 1)) Then
With wsSrc
wsDest.Cells(lidst, 33) = .Cells(lisrc, 3) 'renvoi le status de la migration'
wsDest.Cells(lidst, 40) = .Cells(lisrc, 43) 'renvoi la vague '
wsDest.Cells(lidst, 22) = .Cells(lisrc, 68) 'renvoi commentaire
wsDest.Cells(lidst, 17) = .Cells(lisrc, 66) 'renvoi la date du changement
wsDest.Cells(lidst, 27) = .Cells(lisrc, 49) 'renvoi le New Model PC
wsDest.Cells(lidst, 35) = .Cells(lisrc, 48) 'renvoi Action type HP
End With
Exit For
End If
Next lisrc
Next lidst
End Sub |
Partager