Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lock a control object
I have a 'Lock' button that uses a macro to toggle specific cells in a
worksheet between protected and unprotected (allowing only unlocked cells to be selected). I also have some combo boxes on the worksheet that I would like to protect in the same way (ie. when locked they can't be selected). Is this possible? Thanks, |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lock a control object
YOu can use these lines of code. Since you have a toggle button you can just
set the Enable property of your comboboxes equal to the toggle button value. Hope this helps! If so, click "YES" below. ' lock your combobox ActiveSheet.DropDowns("Drop Down 1").Enabled = False or ' unlock your combobox ActiveSheet.DropDowns("Drop Down 1").Enabled = True or ' use the toggle button value ActiveSheet.DropDowns("Drop Down 1").Enabled = ToggleButton1.Value -- Cheers, Ryan "BRG" wrote: I have a 'Lock' button that uses a macro to toggle specific cells in a worksheet between protected and unprotected (allowing only unlocked cells to be selected). I also have some combo boxes on the worksheet that I would like to protect in the same way (ie. when locked they can't be selected). Is this possible? Thanks, |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Lock a control object
Thanks Ryan,
The 'Enabled' property was the one I was looking for. I used a ComboBox from the Controls toolbar, so I used 'OLEObjects' instead of 'Dropdowns' in the entries below. BRG "Ryan H" wrote: YOu can use these lines of code. Since you have a toggle button you can just set the Enable property of your comboboxes equal to the toggle button value. Hope this helps! If so, click "YES" below. ' lock your combobox ActiveSheet.DropDowns("Drop Down 1").Enabled = False or ' unlock your combobox ActiveSheet.DropDowns("Drop Down 1").Enabled = True or ' use the toggle button value ActiveSheet.DropDowns("Drop Down 1").Enabled = ToggleButton1.Value -- Cheers, Ryan "BRG" wrote: I have a 'Lock' button that uses a macro to toggle specific cells in a worksheet between protected and unprotected (allowing only unlocked cells to be selected). I also have some combo boxes on the worksheet that I would like to protect in the same way (ie. when locked they can't be selected). Is this possible? Thanks, |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
2 Label Options - Forms Object vs Control Box Object | Excel Discussion (Misc queries) | |||
How to lock an ActiveX Control box on the spreadsheet? | Excel Worksheet Functions | |||
lock position of Word object in protected excel spreadsheet | Excel Worksheet Functions | |||
Lock cell control conditionally? | Excel Discussion (Misc queries) | |||
Out of control scroll lock?? | Excel Discussion (Misc queries) |