button to check checkboxes

raffa

New Member
Joined
Dec 28, 2015
Messages
23
Hi everybody,

I have a userform with alot of checkboxes (thinking to change them to optionbuttons ) which must be checked to enter value into the sheet.I want that the checkboxes are always set to false (unchecked)when the userform opens.
My first question :Can i save the checkboxes entry from the user?
Second question: Can I create a button or a checkbox that when clicked the saved entries will appear?
If so can someone help me with this code.thanks alot
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Yes, on the click event of the button, enter in this code:

Code:
Dim Ctr as integer
Ctr = 1
for each ctl in MyForm.controls
   if TypeName(ctl) = "CheckBox" then
        ctl.value=Cells(Ctr,1) 
        Ctr = Ctr +1
   End If
Next ctl

then when it comes time to save the values....

Code:
Dim Ctr as integer
Ctr = 1
for each ctl in MyForm.controls
   if TypeName(ctl) = "CheckBox" then
        Cells(Ctr,1) = ctl.value
        Ctr = Ctr +1
   End If
Next ctl
 
Upvote 0

Forum statistics

Threads
1,223,909
Messages
6,175,313
Members
452,634
Latest member
cpostell

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