PDA

View Full Version : Sleeper: Change interior color based on a check box



austenr
07-14-2005, 08:27 AM
I have a check box in C1. How do you check to see if it checked and if so, highlight A1 & B1? Thanks

Ken Puls
07-14-2005, 08:51 AM
Hi Austen,

Depends on which kind of checkbox you're using. If it's ActiveX and (you created it from the Toolbox menu), then use this:


Private Sub CheckBox1_Click()
If Me.CheckBox1.Value = True Then
Me.Range("A1:B1").Interior.ColorIndex = 35
Else
Me.Range("A1:B1").Interior.ColorIndex = 0
End If
End Sub

If it came from the forms menu, though, you'll have to do something different.

austenr
07-14-2005, 09:09 AM
Came from the forms menu. Oh and BTW I want to do it "on Click"

Bob Phillips
07-14-2005, 09:29 AM
Came from the forms menu. Oh and BTW I want to do it "on Click"

Link it to a cell, and then test that cell value.

austenr
07-14-2005, 09:31 AM
example please

Bob Phillips
07-14-2005, 10:45 AM
example please


=IF(A20,"Checked","Unchhecked")