Looping thru Checkboxes in a worksheet

sharshra

Active Member
Joined
Mar 20, 2013
Messages
276
Office Version
  1. 365
I have to loop thru check boxes in a worksheet & was searching for a solution. I found the following post from mrexcel excel questions forum. Post #2 is exactly what I need.
VBA Code:
    Dim i As Long
    
    For i = 1 To 10
        Worksheets("Sheet1").CheckBoxes("ck_" & i).Value = False
    Next i
But, when I use this, I´m getting an error shown below. Not sure what is going wrong. Can the experts in this forum help please?

Link to a post from mrexcel excel questions forum:
[VBA] loop through all check box buttons on a sheet

Error:
loop checkbox.PNG
 
I executed the code above & it didn´t throw any error. My code is working now.....hurrah!! :) No changes made in the actual code :unsure: Not sure why it was throwing error before & working now. However, the puzzle remains - moving from one to another ;)

The original question on looping thru checkboxes is solved anyway. I will mark this as solution.

Thanks a lot for Domenic, Jaafer (y) You made my day!!! :love:
 
Upvote 0

Excel Facts

Create a chart in one keystroke
Select the data and press Alt+F1 to insert a default chart. You can change the default chart to any chart type

Forum statistics

Threads
1,215,123
Messages
6,123,182
Members
449,090
Latest member
bes000

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