Macro bouton active x

bonjour a tous

Je voudrai savoir si il est possible d'affecter une macro a un bouton active x ?

sur ma feuille 1 exel j'ai bouton 1 , bouton 2, bouton 3 , bouton 4

quand je clic sur bouton 1 il devient bleu , quand je clic sur bouton 2 il devient bleu et le bouton 1 passe au vert ainsi de suite.

maintenant sur le bouton 1 ( feuille 1 ) , je vourdrai rajouter en plus de la couleur , lui attribuer une macro pour aller sur la feuille 2

est ce possible ?

voici les codes que j'ai utilise :

Private Sub CommandButton1_Click()

Range("A1") = "Oui"

CommandButton1.BackColor = RGB(0, 0, 240)

CommandButton2.BackColor = RGB(0, 240, 0)

End Sub

Private Sub CommandButton2_Click()

Range("A1") = "Non"

CommandButton1.BackColor = RGB(0, 240, 0)

CommandButton2.BackColor = RGB(0, 0, 240)

End Sub

Private Sub CommandButton3_Click()

Range("A1") = "Non"

CommandButton2.BackColor = RGB(0, 240, 0)

CommandButton3.BackColor = RGB(0, 0, 240)

End Sub

Private Sub CommandButton4_Click()

Range("A1") = "Non"

CommandButton3.BackColor = RGB(0, 240, 0)

CommandButton4.BackColor = RGB(0, 0, 240)

End Sub

Private Sub CommandButton5_Click()

Range("A1") = "Non"

CommandButton4.BackColor = RGB(0, 240, 0)

CommandButton5.BackColor = RGB(0, 0, 240)

CommandButton5.BackColor = RGB(0, 240, 0)

End Sub

Merci pour votre collaboration .( je vous joint lefichier

lui attribuer une macro pour aller sur la feuille 2

est ce possible ?

ajoute :

Sheets("LeNomDeLaFeuille2").Select

dans ton cas

Sheets("Sheet2").Select

ok ca marche merci

par contre comment faire pour que le bouton 4 qui sera bleu redeviennet vert en cliquant sur bouton 1 ?

faire une boucle en quelque sorte

merci par avance

ajoute ceci

CommandButton4.BackColor = RGB(0, 240, O)

R= red, rouge

G= green, vert

B = blue, bleu

valeurs de 0 à 255

ok ca marche

merci pour tout

Rechercher des sujets similaires à "macro bouton active"