Formule ou alors VBA?
Résolu/Fermé
A voir également:
- Formule ou alors VBA?
- Formule excel - Guide
- Formule si et - Guide
- Formule moyenne excel - Guide
- Formule excel pour additionner plusieurs cellules - Guide
- Mise en forme conditionnelle formule si - Guide
2 réponses
g
Messages postés
1262
Date d'inscription
vendredi 23 avril 2004
Statut
Membre
Dernière intervention
15 mai 2017
572
21 déc. 2009 à 13:16
21 déc. 2009 à 13:16
Bonjour,
Si tu n'as pas Excel 2007, code à mettre dans le module de feuille:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("P1") <> "" Then
Range("A1:Q1").Interior.ColorIndex = 4 'vert
ElseIf Range("O1") <> "" Then
Range("A1:Q1").Interior.ColorIndex = 5 'bleu
ElseIf Range("F1") = "" Then
Range("A1:Q1").Interior.ColorIndex = xlNone
ElseIf Range("F1") < Now And Range("G1") = "" Then
Range("A1:Q1").Interior.ColorIndex = 6 'jaune
ElseIf Range("G1") = "" Then
Range("A1:Q1").Interior.ColorIndex = xlNone
ElseIf Range("G1") < Now Then
Range("A1:Q1").Interior.ColorIndex = 3 'rouge
End If
End Sub
Bonne journée.
Si tu n'as pas Excel 2007, code à mettre dans le module de feuille:
Private Sub Worksheet_SelectionChange(ByVal Target As Range)
If Range("P1") <> "" Then
Range("A1:Q1").Interior.ColorIndex = 4 'vert
ElseIf Range("O1") <> "" Then
Range("A1:Q1").Interior.ColorIndex = 5 'bleu
ElseIf Range("F1") = "" Then
Range("A1:Q1").Interior.ColorIndex = xlNone
ElseIf Range("F1") < Now And Range("G1") = "" Then
Range("A1:Q1").Interior.ColorIndex = 6 'jaune
ElseIf Range("G1") = "" Then
Range("A1:Q1").Interior.ColorIndex = xlNone
ElseIf Range("G1") < Now Then
Range("A1:Q1").Interior.ColorIndex = 3 'rouge
End If
End Sub
Bonne journée.
21 déc. 2009 à 22:22