XL 2016 Un evenement quand click bouttons dans frame

Olivier Desilets

XLDnaute Nouveau
Bonjous je n'arrive pas a trouver la formule qui me permetterait par un click sur l'un des boutons dans un frame
renvoie la valeur caption de ce bouton genre ...

Private Sub usfQuickClock_Initialize()
Dim ctrl As Control
For Each ctrl In Me.frm1.Controls
If TypeOf ctrl Is MSForms.CommandButton Then
If ctrl.Click = True Then
With usfSaisieHeure
.ActiveControl = ctrl.Caption
End With
End If
Next
End Sub

Pour l'instant j'y arrive de façon individuelle mais...
Private Sub CB0145_Click()
With usfSaisieHeure
.ActiveControl = CB0145.Caption
End With
Unload Me
End Sub
 

Discussions similaires