Conditional formatting ????

  • Thread starter dazoloko via OfficeKB.com
  • Start date
D

dazoloko via OfficeKB.com

Dear All

Is it possible to colour a range of cells based upon a check box ie if it is
checked, a particular range is green or if its unchecked the range is red ?

Thanks in anticipation

D
 
N

Nayab

Dear All

Is it possible to colour a range of cells based upon a check box ie if itis
checked, a particular range is green or if its unchecked the range is red?

Thanks in anticipation

D

I think u can do it via Vb. U can check if the checkbox ischecked.
then u can format the range and specify the color
 
D

dazoloko via OfficeKB.com

Thanks for the repsonse, not being an expert on vb can anyone assist with the
code then im assuming if I have more than 1 checkbox relating to different
ranges id need the code for each one ?

Cheers

D

[quoted text clipped - 7 lines]
I think u can do it via Vb. U can check if the checkbox ischecked.
then u can format the range and specify the color
 
M

Mike H

Hi,

Put a checkbox from the 'Forms' toolbox on your sheet. Right click is and
apply this macro

Sub CheckBox1_Click()
If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn Then
Range("A1").Interior.ColorIndex = 3
Else
Range("A1").Interior.ColorIndex = xlNone
End If
End Sub

Change the range and colour to suit your requirements.

Mike
 
D

dazoloko via OfficeKB.com

Mike H

Yet again youve come up with the goods, a true legend !!!

D


Mike said:
Hi,

Put a checkbox from the 'Forms' toolbox on your sheet. Right click is and
apply this macro

Sub CheckBox1_Click()
If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn Then
Range("A1").Interior.ColorIndex = 3
Else
Range("A1").Interior.ColorIndex = xlNone
End If
End Sub

Change the range and colour to suit your requirements.

Mike
[quoted text clipped - 4 lines]
 
M

Mike H

I'm glad I could help

dazoloko via OfficeKB.com said:
Mike H

Yet again youve come up with the goods, a true legend !!!

D


Mike said:
Hi,

Put a checkbox from the 'Forms' toolbox on your sheet. Right click is and
apply this macro

Sub CheckBox1_Click()
If ActiveSheet.CheckBoxes("Check Box 1").Value = xlOn Then
Range("A1").Interior.ColorIndex = 3
Else
Range("A1").Interior.ColorIndex = xlNone
End If
End Sub

Change the range and colour to suit your requirements.

Mike
[quoted text clipped - 4 lines]
 
M

MyVeryOwnSelf

Is it possible to colour a range of cells based upon a check box ie if
it is checked, a particular range is green or if its unchecked the
range is red ?

Here's one way.

After adding a check-box using the Forms tool bar, right-click on the tool
check-box and use
Format control > Control

There, select the "Unchecked" button, and in the "Cell link" indicate a
helper cell in some out-of-the-way place. That cell will contain logical
TRUE or FALSE depending on whether or not the check-box is checked. Then
select the "range of cells" and use
Format > Conditional formatting
With formulas referring to the helper cell.
 
Top