View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Rech Jim Rech is offline
external usenet poster
 
Posts: 2,718
Default When using an Option Button can I...

I assume the option buttons are on a worksheet and they're from the Forms
toolbar...

You can right-click each button, pick Assign Macro to name a macro to be run
when each option button is clicked. The code could be:

Sub OptionButton1_Click()
Range("M42").Locked = True
End Sub

Sub OptionButton2_Click()
Range("M42").Locked = False
End Sub

If the sheet is protected you will have to unprotect/re-protect it before
and after.

--
Jim Rech
Excel MVP
"phil" wrote in message
...
| Lock a particular cell?
|
| I have optYes and optNo. When optYes is selected I would
| like the contents of cell M42 on worksheet WS2 to have a
| "locked" state, whereas no data can be entered. And when
| optNo is selected I would like the contents to be fully
| editable. Is there such a work-around for this?
|
| Thanks in advance for your help.
|
| Phil Diederich