My question is a bit complicated. Let's say I want to have cell B1 be checked automatically for a value and then display a string in D1 cell. But this should only occur if the adjacent check box in C1 is not checked. Currently, I have it to where the check box prompts the action. But it doesn't do it automatically. When i enter the number in B1, nothing happens. The desired action only occurs when I actively check or uncheck a box. Is it possible to check the cell without actuating the checkbox? Please help!!!
Code:
Sub Check_Cell(CRow As Integer, CCol As Integer)
If Cells(CRow, "B") > 5 And Cells(CRow, "B") < 30 Then
Application.EnableEvents = False
Cells(CRow, B) = "Not Complete"
Application.EnableEvents = True
Else
Application.EnableEvents = False
Cells(CRow, B) = Null
Application.EnableEvents = True
End If
End Sub
Sub Process_CheckBox(pObject)
Dim LRow As Integer
Dim LRange As String
'Find location that checkbox resides in
LRow = pObject.TopLeftCell.Row
LCol = pObject.TopLeftCell.Column
LRange = "D" & CStr(LRow)
'Change date in column D, if checkbox is checked
If pObject.Value = True Then
ActiveCell.Font.Color = RGB(0, 0, 0)
ActiveSheet.Range(LRange).Value = Date
'Clear date and insert string in column D, if checkbox is unchecked
Else
Call Check_Cell(LRow, LCol + 1)
End If
End Sub
Private Sub CheckBox1_Click()
Process_CheckBox CheckBox1
End Sub
Last edited by a moderator: