NorthbyNorthwest
Board Regular
- Joined
- Oct 27, 2013
- Messages
- 178
- Office Version
- 365
Hi, everyone. I am using Excel's new checkboxes. This is what I want to achieve. If check box value in column AG is TRUE, then I want checkbox value in column AH to be FALSE. I have code below that loops through the columns and makes changes if necessary. I have to manually trigger the code. I cannot figure out how to get this code to work as an event. In other words, whenever user makes checkbox in AG TRUE, column AH checkbox will change to FALSE, if it is not already FALSE. Could someone help?
VBA Code:
Sub TrueFalse()
Dim i As Integer
'If inactive field checked true in Assignment table then auditors field in table false
Sheet7.Activate
For i = 6 To ActiveSheet.UsedRange.Rows.Count
If Range("AG" & i).value = True Then
Range("AH" & i).value = False
End If
Next i
End Sub