Sub masquer()
Dim couleurs(), cel(), x
couleurs = Array(6, 43, 33, 3)
cel = Array("A10:D20", "F10:I20", "K10:N20", "P10:S20")
v = Range("e2") - 1
Select Case v
Case 0
With Union(Range(cel(1)), Range(cel(2)), Range(cel(3)))
.Interior.ColorIndex = 2: .Font.ColorIndex = 2: .Borders.LineStyle = xlNone
End With
Case 1
With Union(Range(cel(0)), Range(cel(2)), Range(cel(3)))
.Interior.ColorIndex = 2: .Font.ColorIndex = 2: .Borders.LineStyle = xlNone
End With
With Range(cel(1))
.Interior.ColorIndex = couleurs(1): .Font.ColorIndex = -4105
.Borders.LineStyle = 1: .Borders.Weight = xlThick
End With
Case 2
With Union(Range(cel(0)), Range(cel(1)), Range(cel(3)))
.Interior.ColorIndex = 2: .Font.ColorIndex = 2: .Borders.LineStyle = xlNone
End With
With Range(cel(2))
MsgBox .Address
.Interior.ColorIndex = couleurs(2) : .Font.ColorIndex = -4105
.Borders.LineStyle = 1: .Borders.Weight = xlThick
End With
Case 3
With Union(Range(cel(0)), Range(cel(1)), Range(cel(2)))
.Interior.ColorIndex = 2: .Font.ColorIndex = 2: .Borders.LineStyle = xlNone
End With
With Range(cel(3))
.Interior.ColorIndex = couleurs(3): .Font.ColorIndex = -4105
.Borders.LineStyle = 1: .Borders.Weight = xlThick
End With
End Select
End Sub