View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Jim Thomlinson Jim Thomlinson is offline
external usenet poster
 
Posts: 5,939
Default Cell Entry Dependent on Option Control

Here is how I would do it. It does nore require a macro. There are 2 types of
option buttons. For this I would use the option buttons off of the Control
Toolbox and not the ones from the forms toolbar. Place 2 buttons on your
sheet. Right click the buttons and select Properties. In the dialog that
opens for button 1 make the linked cell B1 and for button 2 make the linked
cell B2.
Now on the control toolbox click the icon taht looks like a triangle and
ruler to exit design mode.
Clicking the option buttons should toggle True and False in Cells B1 and B2.
Select Cell A1 and select Data - Validation - Custom and in the formula
box add =$B$1
Select Cell A3:A7 and select Data - Validation - Custom and in the formula
box add =$B$2
Your cells should now be locked down based on the option button values.

You can make the Error dialogs more meaningful by modifying the Validation.
--
HTH...

Jim Thomlinson


"BJ" wrote:

I'm wondering how to control cell entry [data entry generically] based on an
option control.

I have two option buttons. Option Button 1 should allow data entry into
cell A1 for example and Option Button 2 should allow data entry into cells
A3:A7. However, when Option Button 1 is selected I want to disable entry for
cells A3:A7 and when Option Button 2 is selected I want to disable entry for
cell A1.

I'm open to using some sort of control [please explain as I am a VBA rookie]
instead of the spreadsheet cell if that's the only way to make this work.

I've done this with Option Buttons controlling Check Boxes, but I'm not sure
how to control data entry.

Thank you.

B