jeudi 5 novembre 2020

How to deselect all other checkboxes when one is selected

I’m writing a simple macro and am a bit rusty in my VBA skills. The macro has a list of options with “yes”, “no” and “maybe” options to choose from. I used checkboxes rather than option buttons so each option doesn’t have to be in an individual frame.

The code I have written (below) deselects the other options when one is selected, but I have to select it again for it to actually be selected which will be frustrating for the user.

Private Sub Yes_Click()
     No.Value = False
     Maybe.Value = False
End Sub

I have tried adding the additional line

Yes.Value = True

But this then crashes excel when the macro is run.

I can’t find any advice for this problem so any help is greatly appreciated.




Aucun commentaire:

Enregistrer un commentaire