Salut le forum
Claude, ta solution est bonne mais pas avec le mode plein écran.
Un bout de code pour t'amuser, ajout d'un Command Button sur la feuille active
Sub AjoutCommandButton_Feuille()
Dim Ws As Worksheet
Dim Obj As OLEObject
Dim laMacro As String
Dim x As Integer
Set Ws = ActiveSheet
'Ajout CommandButton dans la feuille
Set Obj = Ws.OLEObjects.Add("Forms.CommandButton.1")
With Obj
.Left = 50 'position horizontale
.Top = 50 'position verticale
.Width = 140 'largeur
.Height = 30 'hauteur
.Object.BackColor = RGB(235, 235, 200) 'Couleur de fond
.Object.Caption = "Supprimer données feuille"
End With
'Paramètres pour la création de la macro:
laMacro = "Sub CommandButton1_Click()" & vbCrLf
laMacro = laMacro & "Sheets(""Feuil1"").Select" & vbCrLf
laMacro = laMacro & "End Sub"
With ThisWorkbook.VBProject.VBComponents(ActiveSheet.Name).CodeModule
x = .CountOfLines + 1
.InsertLines x, laMacro
End With
End Sub
Mytå