View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Ryan H Ryan H is offline
external usenet poster
 
Posts: 489
Default 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,