Modification de macro

Boostez vos compétences Excel avec notre communauté !

Rejoignez Excel Downloads, le rendez-vous des passionnés où l'entraide fait la force. Apprenez, échangez, progressez – et tout ça gratuitement ! 👉 Inscrivez-vous maintenant !

keurma

XLDnaute Occasionnel
J'utilise la macro ci dessous. Comment la modifier pour qu'elle s'applique a certaines pages du classeur. Actuellement, elle ne fonctionne qu'avec la premiere. D'avance merci.

Private Sub Worksheet_Change(ByVal Target As Range)
Dim X As Range
For Each X In Range("C5:Q34")

If X.Value = "CA" Then X.Font.ColorIndex = 3
If X.Value = "JU" Then X.Font.ColorIndex = 3
If X.Value = "RTT" Then X.Font.ColorIndex = 5
If X.Value = "MED" Then X.Font.ColorIndex = 3
If X.Value = "TV" Then X.Font.ColorIndex = 3
If X.Value = "AN" Then X.Font.ColorIndex = 3
If X.Value = "linge" Then X.Font.ColorIndex = 1
If X.Value = "cuisine" Then X.Font.ColorIndex = 1
If X.Value = "week" Then X.Font.ColorIndex = 1
If X.Value = "linge/nuit" Then X.Font.ColorIndex = 1
If X.Value = "cuisine/nuit" Then X.Font.ColorIndex = 1
If X.Value = "x/nuit" Then X.Font.ColorIndex = 1
If X.Value = "astreinte" Then X.Font.ColorIndex = 1
If X.Value = "maladie" Then X.Font.ColorIndex = 50
If X.Value = "RH" Then X.Font.ColorIndex = 1
If X.Value = "FERIE" Then X.Font.ColorIndex = 1
If X.Value = "CE" Then X.Font.ColorIndex = 3
If X.Value = "x" Then X.Font.ColorIndex = 1
If X.Value = "C07" Then X.Font.ColorIndex = 3


Next X
End Sub
 
- Navigue sans publicité
- Accède à Cléa, notre assistante IA experte Excel... et pas que...
- Profite de fonctionnalités exclusives
Ton soutien permet à Excel Downloads de rester 100% gratuit et de continuer à rassembler les passionnés d'Excel.
Je deviens Supporter XLD

Discussions similaires

Réponses
4
Affichages
586
Réponses
7
Affichages
366
Retour