When adding a checkbox, how do you access the value from VBA?
All of the following fail
Sheets("Sheet1").chkMyCheck.Checked
Sheets("Sheet1").chkMyCheck.Value
Sheets("Sheet1").Shapes("chkMyCheck").Checked
Sheets("Sheet1").Shapes("chkMyCheck").Value
Sheet1.chkMyCheck.Checked
Sheet1.chkMyCheck.Value
Sheet1.Shapes("chkMyCheck") appears to find the object, but does not expose any properties that look likely for returning the checked state.
Select the Developer tab from the toolbar at the top of the screen. Then click on the Visual Basic option in the Code group. Now the Microsoft Visual Basic editor should appear and you can view your VBA code.
Figured it out
If Sheet1.Shapes("chkMyCheck").ControlFormat.Value = xlOn Then
.....
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With