Bonjour,
Pour faire une mis en forme conditionnelle sous excel 2003, en trifouillant, je suis arrivé à cette macro:
Je voudrais la modifier pour obtenir 2 choses:
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26 Sub formatConditionnelle() Application.ScreenUpdating = False For Each c In [BH2:BH250] 'plage a testée c.Select Dim l As Long l = ActiveCell.Select If ActiveCell.Value = "X" And ActiveCell.Offset(0, 9) <> "" Then ActiveCell.Select Selection.Font.ColorIndex = 45 Else If ActiveCell.Value = "Y" And ActiveCell.Offset(0, 9) = "" Then ActiveCell.Select Selection.Font.ColorIndex = 5 Else ActiveCell.Select Selection.Font.ColorIndex = 1 End If End If Next Application.ScreenUpdating = True Range("BH2").Select End Sub
- La cellule se colore et non la police;
- seules les cellules de la colonne concernée se colorent.
MERCI BEAUCOUP
Partager