VBA: Loop CheckBox ActiveX If Value True, Enaled = False Same Column and Row

morges

New Member
Joined
Jan 20, 2017
Messages
2
Hi!

Im want to make a loop for the purpose of entering and counting votes, so that when one ActiveX CheckBox is clicked the checkboxes in the same row and column are disabled (as you have to prioritise among candidates and can online votes for each one time).

I have 14 columns and 24 rows of checkboxes. I have tried to look into whether I could assign each checkbox to a cell and then disable the cell row and column of the checked cell.

I have attached an image of the sheet and the editor, and hope that you can put me in the right direction of finding a solution. Thank you in advance!

An example of my current code (which is manual and too burdensome to run efficiently):
Private Sub CheckBox1_Click()
If CheckBox1.Value = True Then
CheckBox2.Enabled = False
CheckBox3.Enabled = False
CheckBox4.Enabled = False
CheckBox5.Enabled = False
CheckBox6.Enabled = False
CheckBox7.Enabled = False
CheckBox8.Enabled = False
CheckBox9.Enabled = False
CheckBox10.Enabled = False
CheckBox11.Enabled = False
CheckBox12.Enabled = False
CheckBox13.Enabled = False
CheckBox14.Enabled = False
CheckBox15.Enabled = False
CheckBox29.Enabled = False
[...]
crosscounter = crosscounter + 1
Else
CheckBox2.Enabled = True
CheckBox3.Enabled = True
[...]


Best,
Morten

hbQjY
 

Excel Facts

Square and cube roots
The =SQRT(25) is a square root. For a cube root, use =125^(1/3). For a fourth root, use =625^(1/4).

Forum statistics

Threads
1,213,561
Messages
6,114,317
Members
448,564
Latest member
ED38

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top