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
| Private Sub CommandButton2_Click()
Dim Lig As Long, Ligne As Long, Plage As Range
With Sheets("Suivi ROP")
'recherche incident
If .ComboBox1.ListIndex = -1 Then Exit Sub
Lig = .[D:E].Find(.ComboBox1.Value, , , xlWhole).Row + 2
End With
With Sheets("CRJ")
Ligne = .Cells(.Rows.Count, 1).End(xlUp).Row + 1
If Ligne = 8 Then Ligne = 9
' Lig = [A:A].Find("n° train", , , xlWhole, xlByRows, xlPrevious).Row + 1
.Cells(Ligne, 1) = Cells(Lig, 1)
.Cells(Ligne, 6) = Cells(Lig, 2)
.Cells(Ligne, 4) = Cells(Lig + 7, 2)
.Cells(Ligne, 9) = Cells(Lig + 5, 11)
.Cells(Ligne, 2) = Cells(Lig + 3, 1)
.Cells(Ligne, 3) = Cells(Lig + 4, 1)
End With
With Sheets("Suivi ROP")
Lig = Lig - 2
Set Plage = .Range(.Cells(Lig, 1), .Cells(Lig + 12, 12))
End With
With Sheets("Archive")
Ligne = .Cells(.Rows.Count, 1).End(xlUp).Row
Plage.Copy .Cells(Ligne, 1)
End With
End Sub |