A
alex
Guest
Bonjour,
J'ai un problème pour colorier des cellules:
If CheckBox1.Value = True Then
Range("c37").Value = CheckBox1.Caption
Range("e6,e7,e8,e31").Interior.ColorIndex = 6
masquage1 = False
Else
Range("c37").Value = ""
masquage1 = True
Range("e6,e7,e8,e31").Interior.ColorIndex = xlNone
End If
If CheckBox2.Value = True Then
Range("c44").Value = CheckBox2.Caption
masquage2 = False
Range("e7,e8,e9,e31").Interior.ColorIndex = 6
Else
Range("c44").Value = ""
masquage2 = True
Range("e7,e8,e9,e31").Interior.ColorIndex = xlNone
End If
If CheckBox3.Value = True Then
Range("c50").Value = CheckBox3.Caption
masquage3 = False
Range("e10,e11,e31").Interior.ColorIndex = 6
Else
Range("c50").Value = ""
masquage3 = True
Range("e10,e11,e31").Interior.ColorIndex = xlNone
End If
If CheckBox4.Value = True Then
Range("c56").Value = CheckBox4.Caption
masquage4 = False
Else
Range("c56").Value = ""
masquage4 = True
End If
If CheckBox5.Value = True Then
Range("c61").Value = CheckBox5.Caption
masquage5 = False
Else
Range("c61").Value = ""
masquage5 = True
End If
If CheckBox6.Value = True Then
Range("c68").Value = CheckBox6.Caption
masquage6 = False
Range("e12,e13,e14,e15,e16,e31").Interior.ColorIndex = 6
Else
Range("c68").Value = ""
masquage6 = True
Range("e12,e13,e14,e15,e16,e31").Interior.ColorIndex = xlNone
End If
If CheckBox7.Value = True Then
Range("c73").Value = CheckBox7.Caption
masquage7 = False
Range("e23,e24,e25,e26,e31").Interior.ColorIndex = 6
Else
Range("c73").Value = ""
masquage7 = True
Range("e23,e24,e25,e26,e31").Interior.ColorIndex = xlNone
End If
If CheckBox8.Value = True Then
Range("c81").Value = CheckBox8.Caption
masquage8 = False
Range("e19,e22,e31").Interior.ColorIndex = 6
Else
Range("c81").Value = ""
masquage8 = True
Range("e19,e22,e31").Interior.ColorIndex = xlNone
End If
If CheckBox9.Value = True Then
Range("c89").Value = CheckBox9.Caption
masquage9 = False
Range("e17,e18,e20,e21,e31").Interior.ColorIndex = 6
Else
Range("c89").Value = ""
masquage9 = True
Range("e17,e18,e20,e21,e31").Interior.ColorIndex = xlNone
End If
If CheckBox10.Value = True Then
Range("c93").Value = CheckBox10.Caption
masquage10 = False
Range("e27").Interior.ColorIndex = 6
Else
Range("c93").Value = ""
masquage10 = True
Range("e27").Interior.ColorIndex = xlNone
End If
If CheckBox11.Value = True Then
Range("c100").Value = CheckBox11.Caption
masquage11 = False
Range("e6,e28").Interior.ColorIndex = 6
Else
Range("c100").Value = ""
masquage11 = True
Range("e6,e28").Interior.ColorIndex = xlNone
End If
If CheckBox12.Value = True Then
Range("c104").Value = CheckBox12.Caption
masquage12 = False
Else
Range("c104").Value = ""
masquage12 = True
End If
If CheckBox13.Value = True Then
Range("c108").Value = CheckBox13.Caption
masquage13 = False
Else
Range("c108").Value = ""
masquage13 = True
End If
Quand je sélectionne seulement mes deux premières checkbox, je voudrais en jaune les cellules e6,e7,e8,e9,e31.
Or, j'obtiens en jaune les cellules e7, e8,e9 et pas e6 et e31.
Si quelqu'un a une idée...
Merci, A+
Alex
J'ai un problème pour colorier des cellules:
If CheckBox1.Value = True Then
Range("c37").Value = CheckBox1.Caption
Range("e6,e7,e8,e31").Interior.ColorIndex = 6
masquage1 = False
Else
Range("c37").Value = ""
masquage1 = True
Range("e6,e7,e8,e31").Interior.ColorIndex = xlNone
End If
If CheckBox2.Value = True Then
Range("c44").Value = CheckBox2.Caption
masquage2 = False
Range("e7,e8,e9,e31").Interior.ColorIndex = 6
Else
Range("c44").Value = ""
masquage2 = True
Range("e7,e8,e9,e31").Interior.ColorIndex = xlNone
End If
If CheckBox3.Value = True Then
Range("c50").Value = CheckBox3.Caption
masquage3 = False
Range("e10,e11,e31").Interior.ColorIndex = 6
Else
Range("c50").Value = ""
masquage3 = True
Range("e10,e11,e31").Interior.ColorIndex = xlNone
End If
If CheckBox4.Value = True Then
Range("c56").Value = CheckBox4.Caption
masquage4 = False
Else
Range("c56").Value = ""
masquage4 = True
End If
If CheckBox5.Value = True Then
Range("c61").Value = CheckBox5.Caption
masquage5 = False
Else
Range("c61").Value = ""
masquage5 = True
End If
If CheckBox6.Value = True Then
Range("c68").Value = CheckBox6.Caption
masquage6 = False
Range("e12,e13,e14,e15,e16,e31").Interior.ColorIndex = 6
Else
Range("c68").Value = ""
masquage6 = True
Range("e12,e13,e14,e15,e16,e31").Interior.ColorIndex = xlNone
End If
If CheckBox7.Value = True Then
Range("c73").Value = CheckBox7.Caption
masquage7 = False
Range("e23,e24,e25,e26,e31").Interior.ColorIndex = 6
Else
Range("c73").Value = ""
masquage7 = True
Range("e23,e24,e25,e26,e31").Interior.ColorIndex = xlNone
End If
If CheckBox8.Value = True Then
Range("c81").Value = CheckBox8.Caption
masquage8 = False
Range("e19,e22,e31").Interior.ColorIndex = 6
Else
Range("c81").Value = ""
masquage8 = True
Range("e19,e22,e31").Interior.ColorIndex = xlNone
End If
If CheckBox9.Value = True Then
Range("c89").Value = CheckBox9.Caption
masquage9 = False
Range("e17,e18,e20,e21,e31").Interior.ColorIndex = 6
Else
Range("c89").Value = ""
masquage9 = True
Range("e17,e18,e20,e21,e31").Interior.ColorIndex = xlNone
End If
If CheckBox10.Value = True Then
Range("c93").Value = CheckBox10.Caption
masquage10 = False
Range("e27").Interior.ColorIndex = 6
Else
Range("c93").Value = ""
masquage10 = True
Range("e27").Interior.ColorIndex = xlNone
End If
If CheckBox11.Value = True Then
Range("c100").Value = CheckBox11.Caption
masquage11 = False
Range("e6,e28").Interior.ColorIndex = 6
Else
Range("c100").Value = ""
masquage11 = True
Range("e6,e28").Interior.ColorIndex = xlNone
End If
If CheckBox12.Value = True Then
Range("c104").Value = CheckBox12.Caption
masquage12 = False
Else
Range("c104").Value = ""
masquage12 = True
End If
If CheckBox13.Value = True Then
Range("c108").Value = CheckBox13.Caption
masquage13 = False
Else
Range("c108").Value = ""
masquage13 = True
End If
Quand je sélectionne seulement mes deux premières checkbox, je voudrais en jaune les cellules e6,e7,e8,e9,e31.
Or, j'obtiens en jaune les cellules e7, e8,e9 et pas e6 et e31.
Si quelqu'un a une idée...
Merci, A+
Alex