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
500

Statistiques des forums

Discussions
312 195
Messages
2 086 082
Membres
103 112
dernier inscrit
cuq-laet