View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Enable and disable worksheet controls?

Control Toolbox Toolbar Controls:

Sub Tester1()
Dim obj As OLEObject
For Each obj In ActiveSheet.OLEObjects
If TypeOf obj.Object Is MSForms.CheckBox Or _
TypeOf obj.Object Is MSForms.OptionButton Then
obj.Object.Enabled = False
End If
Next

End Sub

--
Regards,
Tom Ogilvy



"William Deleo" wrote in message
...
Hello,

Is there a way to disable worksheet controls? For
example, I have a sheet with a series of radio buttons and
check boxes. After some data is entered and the buttons
and check boxes are set, I'd like to disable them so thay
cannot be inadvertantly changed. I thought the lock and
protect features would address this, but it seems like
they do not effect the value of the control (only the
location and size and so forth).

In the end, I'd like a macro button on the sheet which
enables and disables particular controls based on the
value of a sepparate check box. I.e., the user sets the
check box to lock (box checked), and calls the macro (by
pressing a button) to disable particular controls and
fixing their values. Or, the user sets the check box to
unlock (box uncheched), and calls the macro to enable the
particular controls, allowing their values to be reset.

Thanks so much for your time!
William DeLeo