Option Explicit
Private Sub CommandButton4_Click()
Dim i As Byte, c As OLEObject
Supprimer_Bouton
For i = 1 To 5
With ActiveSheet.Range("C" & 10 + i)
Set c = ActiveSheet.OLEObjects.Add(ClassType:="Forms.CheckBox.1", Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
c.Name = "CheckBox_" & .Value & i
End With
With ActiveSheet.Range("D" & 10 + i)
Set c = ActiveSheet.OLEObjects.Add(ClassType:="Forms.ComboBox.1", Left:=.Left, Top:=.Top, Width:=.Width, Height:=.Height)
c.Name = "ComboBox" & .Value & i
End With
Next
End Sub
Sub Supprimer_Bouton()
Dim Obj As OLEObject
For Each Obj In ActiveSheet.OLEObjects
If Obj.Name Like "ComboBox*" Or Obj.Name Like "CheckBox*" Then
Obj.Delete
End If
Next Obj
End Sub