I have 2 sheets, Each sheet has a ActiveX Checkbox, and both are linked to to the same cell on sheet2, say A10.
The checkboxes states mirror each other if i check either one, and I can change the value in A10 from true to false, both checkboxes with be unchecked. So far so good.
However, If i put code in the checkbox on sheet1, example below, and change value of A10 from true to false, only the checkbox on Sheet1 gets unchecked.
What's really strange is, if i remove the Else Sheet1.Range("F1").Value = "" part of the code, it works as expected
I tested this on a new, blank workbook to make sure it wasn't something else in my project.
I also tested with both checkboxes on the same sheet, and that works as expected
Thanks for any help
The checkboxes states mirror each other if i check either one, and I can change the value in A10 from true to false, both checkboxes with be unchecked. So far so good.
However, If i put code in the checkbox on sheet1, example below, and change value of A10 from true to false, only the checkbox on Sheet1 gets unchecked.
What's really strange is, if i remove the Else Sheet1.Range("F1").Value = "" part of the code, it works as expected
I tested this on a new, blank workbook to make sure it wasn't something else in my project.
I also tested with both checkboxes on the same sheet, and that works as expected
Thanks for any help
VBA Code:
Private Sub CheckBox1_Click()
If Sheet1.CheckBox1 = True Then
Sheet1.Range("F1").Value = Sheet1.Range("E1").Value
Else '<---- if this and next line are removed, it works as expected
Sheet1.Range("F1").Value = ""
End If
End Sub