Bonjour, je cherche sans sucée a faire transférer le contenu de deux cellules après remplissage...
Private Sub Worksheet_Deactivate()
Dim planning, bulletin, n&, i&, j&, m&, ok As Boolean
planning = Sheets("Feuil1").Range("e1").CurrentRegion
n = Sheets("Feuil2").Cells(Rows.Count, "a").End(xlUp).Row
bulletin = Sheets("Feuil2").Range("a1:d1").Resize(n)
i = 1
Do
If IsNumeric(bulletin(i, 2)) And IsDate(bulletin(i, 3)) Then
ok = False
For m = 1 To UBound(planning)
If planning(m, 3) = bulletin(i, 2) Then
For j = 1 To UBound(planning, 2)
If planning(3, j) = bulletin(i, 3) Then
planning(m, j) = bulletin(i, 4)
ok = True
Exit For
End If
Next j
End If
If ok Then Exit For
Next m
End If
i = i + 1
Loop Until i > UBound(bulletin)
Sheets("Feuil1").Range("e1").CurrentRegion = planning
End Sub
Private Sub Worksheet_Deactivate()
Dim planning, bulletin, n&, i&, j&, m&, ok As Boolean
planning = Sheets("Feuil1").Range("e1").CurrentRegion
n = Sheets("Feuil2").Cells(Rows.Count, "a").End(xlUp).Row
bulletin = Sheets("Feuil2").Range("a1:d1").Resize(n)
i = 1
Do
If IsNumeric(bulletin(i, 2)) And IsDate(bulletin(i, 3)) Then
ok = False
For m = 1 To UBound(planning)
If planning(m, 3) = bulletin(i, 2) Then
For j = 1 To UBound(planning, 2)
If planning(3, j) = bulletin(i, 3) Then
Sheets("Feuil1").Cells(m, j) = bulletin(i, 4)
ok = True
Exit For
End If
Next j
End If
If ok Then Exit For
Next m
End If
i = i + 1
Loop Until i > UBound(bulletin)
End Sub