I made some minor changes to cemregunay's code. But I still can't figure out how to store the original value BEFORE it turns to "99999" (Checkbox OFF) and be able to bring it back when checkbox is ON. This value in Cell D10 can be edited whenever checkbox is ON. Any idea?
Formula:
Private Sub CheckBox1_Click()
Dim con_budg As Long
Dim con_inf As Long
con_inf = 99999
If CheckBox1.Value = True Then Range("D10").Value = con_budg: Range("D10").Locked = False: Call change_normal
If CheckBox1.Value = False Then Range("D10").Value = con_inf: Range("D10").Locked = True: Call change_grey
End Sub
Sub change_grey()
Range("D10").Select
With Selection.Interior
.Pattern = xlSolid
.Color = RGB(217, 217, 217)
End With
End Sub
Sub change_normal()
Range("D10").Select
With Selection.Interior
.Pattern = xlSolid
.Color = RGB(255, 255, 0)
End With
End Sub
Bookmarks