How to set a series of listboxes?

dave8

Active Member
Joined
Jul 8, 2007
Messages
275
I have a set of listboxes on a worksheet and have a button to clear them. That is, after listboxes have been checked, a button unchecks them. I have code that individually unchecks them: checkbox1.value = False, checkbox2.value = false.... I have about twenty checkboxes on the sheet. Is there a way to write a loop to set the values to false? This doesn't work: checkbox(i).value = false.
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
You have listboxes but you want to set the values of checkboxes to false?

If it is checkboxes are each of them linked to a cell?

If they are then you can just set the value(s) of the linked cell(s) to FALSE.
 
Upvote 0
I used the checkboxes from the Toolbox and put them on the worksheet. I didn't link them to any cell and were freely place on the worksheet.
 
Upvote 0
Which toolbox?

Form or ActiveX?
 
Upvote 0
Sub chkForms()
ActiveSheet.CheckBoxes = False
End Sub

or

Sub chkControls()
For nr = 1 To ActiveSheet.OLEObjects.Count
ActiveSheet.OLEObjects("Checkbox" & nr).Object = False
Next
End Sub
 
Upvote 0

Forum statistics

Threads
1,226,230
Messages
6,189,770
Members
453,568
Latest member
LaTwiglet85

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