VBA for unlocking numerous form control checkboxes

petespec

New Member
Joined
Dec 3, 2018
Messages
2
When I lock my worksheet, the form control checkboxes can't be checked or unchecked, even when the cells they are in are unprotected. However I can when the actual checkbox is unprotected. Just takes too many steps (rt click the checkbox, open form controls, uncheck the "locked" in the protection tab) to do this to all 973 of them in the C23:C1000 range. Looked far and wide for a macro that would do this, but not successful. Even tried modifying a few similar macros, still no success. I have been able to modify numerous other macros to work as needed, just don't have the programming skills to figure this one out. I would appreciate any help anyone can offer. Thanks
 

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
Code:
[color=darkblue]Sub[/color] UnlockCBs()
    [color=darkblue]Dim[/color] cb [color=darkblue]As[/color] CheckBox
    [color=darkblue]For[/color] [color=darkblue]Each[/color] cb [color=darkblue]In[/color] ActiveSheet.CheckBoxes
        cb.Locked = [color=darkblue]False[/color]
    [color=darkblue]Next[/color] cb
[color=darkblue]End[/color] [color=darkblue]Sub[/color]
 
Upvote 0
Code:
[COLOR=darkblue]Sub[/COLOR] UnlockCBs()
    [COLOR=darkblue]Dim[/COLOR] cb [COLOR=darkblue]As[/COLOR] CheckBox
    [COLOR=darkblue]For[/COLOR] [COLOR=darkblue]Each[/COLOR] cb [COLOR=darkblue]In[/COLOR] ActiveSheet.CheckBoxes
        cb.Locked = [COLOR=darkblue]False[/COLOR]
    [COLOR=darkblue]Next[/COLOR] cb
[COLOR=darkblue]End[/COLOR] [COLOR=darkblue]Sub[/COLOR]


Thank you so much! That worked perfectly.
 
Upvote 0

Forum statistics

Threads
1,223,889
Messages
6,175,224
Members
452,620
Latest member
dsubash

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