Disable a checkbox dependant upon cell data

F

frendabrenda1

I have a checkbox set up (NOT on a form) that I would like to disable when a
corresponding cell says "Not Applicable".

If a macro must be used for this....where does the code go?

Thank you for any info.
 
M

mas_detokyo

I think, you can do it by putting the code below to the sheet macro
which your checkbox resides.

Code:
--------------------

Private Sub Worksheet_Change(ByVal Target As Range)
On Error GoTo EXITSUB:
Me.CheckBox1.Enabled = IIf(Range("$A$1").Value = "NA", False, True)
EXITSUB:
End Sub

--------------------

Assumption:
1. CheckBox is named as "CheckBox1".
2. Corresponding cell is "$A$1".
3. Disable CheckBox when the cell "$A$1" get value "NA"
You can change the code accordingly as you want.

mas
 
Top