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 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68
| Sub vocabulaire()
Dim plagen As Range
Dim NbcellViden As Integer
Dim plagem As Range
Dim NbcellVidem As Integer
Dim plageb As Range
Dim NbcellVideb As Integer
Dim plagev As Range
Dim NbcellVidev As Integer
Dim plageo As Range
Dim NbcellVideo As Integer
Dim plagej As Range
Dim NbcellVidej As Integer
Dim i As Integer
For i = 2 To 19
Cells(4, i).Select
Set plagen = ActiveSheet.Range(Cells(22, i), Cells(24, i))
NbcellViden = plagen.SpecialCells(xlCellTypeBlanks).Count
Set plagem = ActiveSheet.Range(Cells(18, i), Cells(21, i))
NbcellVidem = plagem.SpecialCells(xlCellTypeBlanks).Count
Set plageb = ActiveSheet.Range(Cells(15, i), Cells(17, i))
NbcellVideb = plageb.SpecialCells(xlCellTypeBlanks).Count
Set plagev = ActiveSheet.Range(Cells(11, i), Cells(14, i))
NbcellVidev = plagev.SpecialCells(xlCellTypeBlanks).Count
Set plageo = ActiveSheet.Range(Cells(8, i), Cells(10, i))
NbcellVideo = plageo.SpecialCells(xlCellTypeBlanks).Count
Set plagej = ActiveSheet.Range(Cells(5, i), Cells(7, i))
NbcellVidej = plagej.SpecialCells(xlCellTypeBlanks).Count
If NbcellViden = 0 Then
ActiveCell.Interior.Color = RGB(0, 0, 0)
ElseIf NbcellVidem = 0 Then
ActiveCell.Interior.Color = RGB(102, 51, 0)
ElseIf NbcellVideb = 0 Then
ActiveCell.Interior.Color = RGB(0, 112, 192)
ElseIf NbcellVidev = 0 Then
ActiveCell.Interior.Color = RGB(0, 176, 80)
ElseIf NbcellVideo = 0 Then
ActiveCell.Interior.Color = RGB(247, 150, 70)
ElseIf NbcellVidej = 0 Then
ActiveCell.Interior.Color = RGB(255, 255, 0)
Else
ActiveCell.Interior.Color = RGB(255, 255, 255)
End If
Next i
End Sub |
Partager