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
 

Some videos you may like

Excel Facts

Do you hate GETPIVOTDATA?
Prevent GETPIVOTDATA. Select inside a PivotTable. In the Analyze tab of the ribbon, open the dropown next to Options and turn it off

AlphaFrog

MrExcel MVP
Joined
Sep 2, 2009
Messages
16,265
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]
 

petespec

New Member
Joined
Dec 3, 2018
Messages
2
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.
 

Watch MrExcel Video

Forum statistics

Threads
1,098,873
Messages
5,465,205
Members
406,418
Latest member
HBpenc1l

This Week's Hot Topics

Top