Option Explicit
Sub Sauvegarde()
Dim c
Dim Repertoire As String, Sep As String, Fichier As String
Dim wBase As Workbook, fBase As Worksheet
Dim wDestination As Workbook, fDestination As Worksheet
If [b4] = "" Then MsgBox "Saisir un nom!": [b4].Select: Exit Sub
If [a12] = "" Then MsgBox "Choisir un produit!": [b12].Select: Exit Sub
Repertoire = ThisWorkbook.Path
Sep = Application.PathSeparator
Set wBase = ThisWorkbook
Set fBase = wBase.Sheets("Formulaire")
fBase.Copy
Set wDestination = ActiveWorkbook
Set fDestination = wDestination.Sheets("Formulaire")
With fDestination
For Each c In [a1:e21]: c.Value = c.Value: Next c
.Shapes("monbouton").Delete
.UsedRange.Validation.Delete
.[a1].Select
Fichier = .[a1] & " " & Format(.[b1], "0000") & " " & .[e1] & " " & .[f1] & " " & .[b4]
End With
With wDestination
.SaveAs Filename:=Repertoire + Sep + "Archives" + Sep + Fichier
MsgBox Fichier & " sauvegardé(e)"
.Close
End With
With fBase
.[b1] = .[b1] + 1
.Range("B4,A12:A20,C12:C20").ClearContents
End With
wBase.Save
End Sub