Please Help!checkbox relative reference

A

Adresmith

I have about 400 checkboxes on multi tabs of a multi tab control.
They are named/set up as follows:

CheckBoxA CheckBoxB CheckBoxC
CheckBoxD CheckBoxE CheckBoxF.....

I set up code to ensure that if CheckBoxA is Checked, CheckBoxB and
will be unchecked etc. (see below)

My problem is, I don't want to write code for each CheckBox's OnClic
Event. I want to know if there is a way to reference the CheckBoxe
around the current checkbox using some type of relative reference.

My current code is:

Private Sub CheckBoxA_Click()
If CheckBoxA = True Then
CheckBoxB.Value = Not CheckBoxA.Value
CheckBoxC.Value = Not CheckBoxA.Value
End If
End Sub

If anyone can help me modify this to make my life easier, I would b
sooooo appreciative.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top