Sub Copier()
Dim wbkc As Workbook, wbks As Workbook, i&, fin&, lig&, t$
t = Timer
Application.ScreenUpdating = False
Set wbks = ThisWorkbook
If IsOpen("Info2010 - Lomme.xls") Then Windows("Info2010 - Lomme.xls").Activate: Set wbkc = ActiveWorkbook: GoTo 1
Set wbkc = Workbooks.Open("K:\Stat Journaliéres\Info2010 - Lomme.xls")
1
wbks.Activate
With Feuil4
x = CDate(.Range("A28"))
If x = 0 Then MsgBox "Vous n'avez pas de date en Personnel B2", , "Il Manque la date": Exit Sub
lig = wbkc.Sheets("Messagerie").Columns(1).Find(x).Row
For i = 2 To 15
wbkc.Sheets("Messagerie").Cells(lig, i + 24) = Format(.Cells(4, i).Value, "0.00")
Next i
lig = wbkc.Sheets("Effectifs").Columns(1).Find(x).Row
For i = 2 To 3
wbkc.Sheets("Effectifs").Cells(lig, i + 25) = Format(.Cells(8, i).Value, "0")
Next i
For i = 2 To 3
wbkc.Sheets("Effectifs").Cells(lig, i + 34) = Format(.Cells(12, i).Value, "0")
Next i
lig = wbkc.Sheets("Affrètement").Columns(1).Find(x).Row
For i = 2 To 5
wbkc.Sheets("Affrètement").Cells(lig, i + 7) = .Cells(19, i).Value
Next i
lig = wbkc.Sheets("Logistique").Columns(1).Find(x).Row
For i = 2 To 5
wbkc.Sheets("Logistique").Cells(lig, i + 11) = .Cells(24, i).Value
Next i
For i = 2 To 7
wbkc.Sheets("Logistique").Cells(lig, i + 19) = .Cells(29, i).Value
Next i
End With
With Feuil5
lig = wbkc.Sheets("Effectifs").Columns(1).Find(x).Row
For i = 2 To 10
wbkc.Sheets("Effectifs").Cells(lig, i + 15) = Format(.Cells(6, i).Value, "0")
Next i
End With
MsgBox "Vous avez copié vos infos en " & Format(Timer - t, "0.0 s")
wbkc.Close SaveChanges:=True
wbks.Close SaveChanges:=True
End Sub