Private Sub CommandButton5_Click()
Dim messheets, NOM$, FORM As Byte, vEMPLACEMENT$
messheets = Array("Feuil1", "Feuil2", "Feuil5") 'mettre les noms de sheets que tu veux ici
If Sheets("V3").Range("G27") = "" Then
If MsgBox("Vous devez préciser le nom du client !", vbOKOnly + vbInformation, "vous informe") = vbAbort Then Exit Sub
ElseIf Sheets("V3").Range("H27") <> "xlsx" And Sheets("V3").Range("H27") <> "xlsm" Then
If MsgBox("Vous devez préciser l'extension du fichier xlsx ou xlsm !", vbOKOnly + vbInformation, "vous informe") = vbAbort Then Exit Sub
Else
NOM = Sheets("V3").Range("G27") & "_" & Format(Now, "dd-mm-yyyy")
FORM = IIf(Sheets("V3").Range("H27") = "xlsx", 51, 52)
vEMPLACEMENT = ThisWorkbook.Path & "\"
Sheets(messheets).Copy ' a pour effet de copier les sheets dans un new classeur
ActiveWorkbook.UpdateLinks = xlUpdateLinksNever
Application.DisplayAlerts = False
With ActiveWorkbook
.SaveAs vEMPLACEMENT & NOM, FORM
.Close
End With
End If
'peut on fermer aussi le xlsm <<!!sans fermer Excel ?>>!!
'ben...
ThisWorkbook.Close
End Sub