XL 2010 Créer boutons qui colorie une cellule sélectionnée.

DAVID-44-

XLDnaute Occasionnel
Bonjour à tous,
Je souhaiterais créer des boutons qui colorient avec une police en blanc une cellule sélectionnée.
Je sélectionne la cellule "B4" et en cliquant sur le bouton bleu, la cellule avec le numéro "2" se transforme comme dans l'exemple (fichier joins).
Pour la cellule "B7", je clique sur le bouton rouge, etc.
Merci de votre aide.
Bonne journée.
Cordialement.
David.
 

Pièces jointes

  • Classeur1.xlsx
    9.8 KB · Affichages: 12

Eric C

XLDnaute Barbatruc
RE
Code modifié

VB:
Private Sub Rouge_Click()
With ActiveCell
.Interior.ColorIndex = 3
.Font.ColorIndex = 2
End With
Unload USF1
End Sub
Private Sub Bleu_Click()
With ActiveCell
.Interior.ColorIndex = 5
.Font.ColorIndex = 2
End With
Unload USF1
End Sub
Private Sub Vert_Click()
With ActiveCell
.Interior.ColorIndex = 4
.Font.ColorIndex = 2
End With
Unload USF1
End Sub
Private Sub Orange_Click()
With ActiveCell
.Interior.ColorIndex = 46
.Font.ColorIndex = 2
End With
Unload USF1
End Sub
@+
 

Discussions similaires

  • Question
Microsoft 365 Boutons
Réponses
28
Affichages
487

Statistiques des forums

Discussions
312 103
Messages
2 085 324
Membres
102 862
dernier inscrit
Emma35400