Strange CheckBox issue

hazmat

New Member
Joined
Jun 14, 2019
Messages
39
Office Version
  1. 2016
Platform
  1. Windows
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

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
 

Excel Facts

Copy a format multiple times
Select a formatted range. Double-click the Format Painter (left side of Home tab). You can paste formatting multiple times. Esc to stop
I can't replicate that in 365.

Edit: scratch that, was still in design mode. It does do the same in 365.
 
Upvote 0
I can't replicate that in 365.

Edit: scratch that, was still in design mode. It does do the same in 365.
Thanks for confirming it wasn’t just me

My work around is: Instead of changing the linked cell to control both checkboxes, I am now directly changing the state of one of the checkboxes, which changes the linked cell value, which changes the state of the other checkbox
 
Upvote 0

Forum statistics

Threads
1,221,310
Messages
6,159,176
Members
451,543
Latest member
cesymcox

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top