mercredi 15 novembre 2017

How do I get checkbox value in a sheet?

I have multiple checkboxes called cBox1, cBox2 etc in a sheet called 'Images'.

enter image description here

I am trying to get whether a checkbox is checked or not with the below code:

If ThisWorkbook.Worksheets(2).Shapes("cBox1").OLEFormat.Object.Value = 0 Then
    totalOfWeldsInOrder = totalOfWeldsInOrder + 1
    s1 = 0
    notInOrder = True
End If

However, the value never changes.

How can I get the checked value of the checkboxes?

I have also tried the below, with no success:

If ThisWorkbook.Worksheets(2).Shapes("cBox1").OLEFormat.Object.Value = -4146 Then
    totalOfWeldsInOrder = totalOfWeldsInOrder + 1
    s1 = 0
    notInOrder = True
End If




Aucun commentaire:

Enregistrer un commentaire