I have a check box that is linked to a specific cell. How can I get the cell
that it is linked to change to a certain color when I check the box.
Thanks
I have a check box that is linked to a specific cell. How can I get the cell
that it is linked to change to a certain color when I check the box.
Thanks
Hi Oppy,
Assuming that the checkbox is from the Control ToolBox, try:
'===============>>
Private Sub CheckBox1_Click()
With CheckBox1
If .Value = True Then
Range(.LinkedCell).Interior.ColorIndex = 3
Else
Range(.LinkedCell).Interior.ColorIndex = xlNone
End If
End With
End Sub
'<<===============
This is worksheet event code and should be pasted into the worksheets's code
module (not a standard module and not the workbook's ThisWorkbook module):
*******************************************
Right-click the worksheet's tab
Select 'View Code' from the menu and paste the code.
Alt-F11 to return to Excel.
Change CheckBox1 to the name of your checkbox.
---
Regards,
Norman
"Oppy" <[email protected]> wrote in message
news:[email protected]...
>I have a check box that is linked to a specific cell. How can I get the
>cell
> that it is linked to change to a certain color when I check the box.
>
> Thanks
Or maybe just use format|conditional formatting?
Oppy wrote:
>
> I have a check box that is linked to a specific cell. How can I get the cell
> that it is linked to change to a certain color when I check the box.
>
> Thanks
--
Dave Peterson
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks