CommandButton avec plusieurs actions ???

Bonjour,

est il possible qu'un CommandButton puisse réaliser plusieurs commandes :

pour l'instant j'arrive à en faire 2 avec changement de couleur, mais puis je en faire 3 ou 4 ou + et si oui comment ???

merci d'avance
Configuration: Windows Vista
Internet Explorer 7.0

3 réponses

  1. Ah, c'est du VBA sur Excel, c'est ça ?
    Il aurait fallu commencer par là ;)

    Désolé je ne peux pas t'aider...
    1. Bonjour,

      Actuelement j'arrive à luis faire faire 2 actions le bouton change de couleur suivant les actions:

      Exemple :
      Private Sub CommandButton19_Click()
      Dim Motif As String
      Motif = CommandButton19.Caption

      '----------- Couleur du bouton et action --------------
      If Motif = "Acceuil" Then
      UserForm4.Height = 42 'Agrandir
      CommandButton19.Caption = "Acceuil "
      With CommandButton19
      .BackColor = RGB(100, 255, 255) 'bleu
      With .Font
      .Size = 10
      .Bold = True
      End With

      CommandButton18.Visible = False
      CommandButton2.Visible = False
      CommandButton17.Visible = False
      CommandButton9.Visible = True
      CommandButton16.Visible = True
      End With
      Else
      UserForm4.Height = 42 'Réduire
      CommandButton19.Caption = "Acceuil"
      With CommandButton19
      .BackColor = RGB(255, 128, 128) 'vert
      With .Font
      .Size = 10
      .Bold = True
      End With

      CommandButton18.Visible = True
      CommandButton2.Visible = True
      CommandButton17.Visible = True
      CommandButton9.Visible = False
      CommandButton16.Visible = False
      End With
      End If
      End Sub

      Mais est il possible de lui en faire faire +