Bonjour,
Cette MFC par VBA m’intéresse mais je souhaite appliquer la couleur aux quatre cellules qui sont sur la droite de la cellule de référence « Cells(i, 1) ». Je n’y arrive pas pouvez vous m’aider ?
MERCI

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
27
Sub MEF()
Dim endofcolumn As Long
endofcolumn = 500
For i = 1 To endofcolumn
 Select Case Cells(i, 1).Value
 
    Case Is = "8"
   Cells(i, 1).Interior.ColorIndex = 3
    Case Is = "1"
    Cells(i, 1).Interior.ColorIndex = 10
    Case Is = "2"
    Cells(i, 1).Interior.ColorIndex = 20
    Case Is = "3"
    Cells(i, 1).Interior.ColorIndex = 28
    Case Is = "4"
    Cells(i, 1).Interior.ColorIndex = 44
    Case Is = "5"
    Cells(i, 1).Interior.ColorIndex = 45
    Case Is = "6"
    Cells(i, 1).Interior.ColorIndex = 50
    Case Is = "7"
    Cells(i, 1).Interior.ColorIndex = 55
 
    '...et ainsi de suite
 End Select
 Next i
End Sub