Bonjour toutes et tous
Remerciements à Gabin et à M12 ^^^^
on peut aussi supprimer le bouton de la macro 'Création fiche client' pour les new(s) classeur(s) cré(s) en rajoutant dans le code voir plus-bas* (ici*)
ActiveWorkbook.ActiveSheet.Shapes.Range(Array("Bouton 1")).Delete
donc:
Sub Creation_Client()
Dim Client As String
Dim n As Long, k As Long
n = 2
k = 2
If Cells(n, 1) <> "" Then Client = Cells(n, 1) Else Exit Sub
While Cells(n - 1, 1) <> ""
If Client <> Cells(n, 1) Then
Range("1:1," & k & ":" & n - 1).Copy
Workbooks.Add
Range("A1").Select
ActiveSheet.Paste
ActiveWorkbook.ActiveSheet.Shapes.Range(Array("Bouton 1")).Delete ' ici*
ActiveWorkbook.SaveAs Filename:= _
ThisWorkbook.Path & "\Fichier Client " & Client & ".xlsx", FileFormat:= _
xlOpenXMLWorkbook, CreateBackup:=False
ActiveWindow.Close
k = n
Client = Cells(n, 1)
Else
n = n + 1
End If
Wend
End Sub
crdlt,
André