mercredi 12 février 2020

VBA How to examine checkeboxes in two different columns

I have got serveral checkboxes in column D and F which are tested whether they are checked or not as seen below. The issue is that the macro keeps examine the checkbox in column D. I dont know how to get it to look into the checkbox in column F as well.

For Each objCheckBox In Worksheet(...).CheckBoxes
    With objCheckBox

        If objCheckBox.TopLeftCell.Column = 4 And objCheckBox.Value = xlOn And _
           objCheckBox.TopLeftCell.Column = 6 And objCheckBox.Value = xlOff Then

            .......


        End with



Aucun commentaire:

Enregistrer un commentaire