bonjour,
mon objectif est de colorer dans la colonne F les cellules selon les valeurs
cellule = 1 couleur 28
cellule = 2 couleur 45, ça ne marche pas

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
Sub Mise_En_Forme()
 
Dim fin As Long
Dim li As Long
Dim v
 
 
Const col = "F"
 
 
fin = Range(col & Rows.Count).End(xlUp).Row
v = Range(col & fin).Value
For li = 1 To fin
  If Range(col & li) <> "" Then
    Select Case v
      Case "1": Range(col & li).Interior.ColorIndex = 28
      Case "2": Range(col & li).Interior.ColorIndex = 45
    End Select
  End If
Next li
 
 
 
End Sub