Re : 2 petites questions VBA
Bonsoir à vous,
un essai de syntaxe pour que le bouton active une macro, change de nom et de couleur :
Private Sub CommandButton1_Click()
If CommandButton1.Caption = "Run" Then
CommandButton1.BackColor = RGB(255, 0, 0) 'Rouge
CommandButton1.Caption = "Stop"
ElseIf CommandButton1.Caption = "Stop" Then
CommandButton1.BackColor = RGB(0, 255, 0) 'Vert
CommandButton1.Caption = "Run"
End If
End Sub
Private Sub UserForm_Initialize()
CommandButton1.BackColor = RGB(0, 255, 0) 'Vert
CommandButton1.Caption = "Run"
End Sub
Cordialement
Bernard