Bonjour à tous,

Je suis entrain de faire ma première application excel et je souhaiterais avoir un bouton qui ajoute un morceau de formulaire qui contient d'autre boutons Exemple:

Button1: ajouter un système de mesure
Résultat: button2 ajouter une mesure pour le système avec l'id 1
Si on click encore sur le button1
Résultat: button3 ajouter une mesure pour le système avec l'id 2

Si je résume: je ne sais pas comment faire un bouton qui ajoute d'autre bouton et action?


Merci beaoucoup!
Le code que je souhaiterais répliquer:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
 
'proof mesure button add device
Private Sub CommandButton1_Click()
    With ActiveSheet
        .OLEObjects("CommandButton1").Object.Caption = "ajouter appareil"
    End With
 
End Sub
 
Private Sub CommandButton2_Click()
    With ActiveSheet
        .OLEObjects("CommandButton2").Object.Caption = "ajouter mesures"
    End With
    'appel le dispatcher
    add_proof_mesure
End Sub
 
 
Private Sub CommandButton3_Click()
    With ActiveSheet
        .OLEObjects("CommandButton3").Object.Caption = "5 dernières mesures"
    End With
    'appel le dispatcher
    get_five_last_record
End Sub
 
Private Sub SpinButton1_Change()
    Dim limit As Variant
    Dim offset As Variant
    Dim value As Variant
    With SpinButton1
        .Min = 0
        .Max = 10
    End With
    value = SpinButton1.value
    Debug.Print value
    offset = value * 5
    limit = offset + 5
    get_five_last_record limit, offset
End Sub