Looping thru Checkboxes in a worksheet

sharshra

Active Member
Joined
Mar 20, 2013
Messages
404
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

Using Function Arguments with nested formulas
If writing INDEX in Func. Arguments, type MATCH(. Use the mouse to click inside MATCH in the formula bar. Dialog switches to MATCH.

Forum statistics

Threads
1,224,823
Messages
6,181,183
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

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