Sub actualisation_devis()
Dim wb As Workbook, ws As Worksheet, ws2 As Worksheet
Dim i As Integer, lig As Integer, lig2 As Integer
Application.ScreenUpdating = False
Set wb = ThisWorkbook
Set ws = wb.Worksheets("CA")
Set ws2 = wb.Worksheets("PLANNING")
ws2.Range("B5:F300").ClearContents
'Calcul du nombre de ligne total sur la colonne C
lig = ws.Cells(Rows.Count, 3).End(xlUp).Row
lig2 = 5
'Boucle
For i = 7 To lig
If ws.Cells(i, 14) = 1 Then
ws2.Cells(lig2, 2) = ws.Cells(i, 3)
ws2.Cells(lig2, 3) = ws.Cells(i, 4)
ws2.Cells(lig2, 4) = ws.Cells(i, 5)
ws2.Cells(lig2, 5) = ws.Cells(i, 10)
ws2.Cells(lig2, 6) = ws.Cells(i, 9)
lig2 = lig2 + 1
End If
Next i
MsgBox "mise à jour terminée !"
End Sub