Sub imprimer()
'
Dim F As Worksheet, lig&, c As Range, n%
Dim imprimer As Byte
Sheets("Personnel").Unprotect "manu01"
' If MsgBox("Le planning est-il complet ?", vbYesNo + vbQuestion, "Vers l'impression") = vbNo Then Exit Sub
Set F = Sheets("Personnel")
lig = F.Cells.Find("*", , xlValues, , xlByRows, xlPrevious).Row + 1
F.Cells(lig, 2).Value = Sheets("Planning").Range("B1").Value ' date
n = 2
For Each c In Sheets("Planning").[B8,B10:B15,G8,G10:G15,B17,B19:B22,G17,G19:G23,B25:B29] ' plage à adapter
n = n + 1
F.Cells(lig, n) = c.Value
Next c
' F.Cells(lig, 1).Resize(, n + 1).Borders.Weight = xlMedium ' mise en forme des bordures
' F.Columns.AutoFit 'ajustement largeurs
' F.Activate 'facultatif
' F.[A1].CurrentRegion.Name = "T" 'plage nommée
imprimer = MsgBox("Voulez-vous l'imprimer ?", vbYesNo + vbQuestion, "Vers l'impression")
If imprimer = vbYes Then Worksheets("Planning").PrintPreview
ThisWorkbook.Save
imprimer = MsgBox("Voulez-vous supprimer le planning?", vbYesNo + vbQuestion, "Sauvegarde")
If imprimer = vbYes Then ThisWorkbook.Save
With Sheets("Planning")
.Unprotect "manu01"
.Range("C4:C5,B8:C8,B10:C15,G8:H8,G10:H15,B17:C17,B19:C22,G17:H17,G19:H23,B25:C29").Value = ""
.Protect "manu01"
Range("A8").Value = "GAP1"
Range("F8").Value = "GAP2"
Range("A17").Value = "GAP3"
Range("F17").Value = "GAP CE"
Range("A25").Value = "Extrusion"
Range("A26").Value = "Plaques"
Range("A27").Value = "Réserva"
Range("A28").Value = "Réserva"
Range("A29").Value = "Divers"
Range("F23").Value = "CHAMBOSS"
End With
'ThisWorkbook.Save
End Sub