Checkbox!

danielalmada

New Member
Joined
Oct 21, 2002
Messages
2
Is there a way to "turn off" and "turn on" cells when i click on a checkbox. I want to input grades on a cell but I need that cell to be "turned on" by a checkbox on a cell next to it. If i don't press the checkbox it shouldn't allow me to input the grade.
 

Excel Facts

Wildcard in VLOOKUP
Use =VLOOKUP("Apple*" to find apple, Apple, or applesauce

lenze

Legend
Joined
Feb 18, 2002
Messages
13,690
OK. Use Data Validation. First, link your checkboxes to cells (They can be hidden). Say you link your checkbox to K3. Then validate your input cell using the custom option. Formula =K3=TRUE
 

Corticus

Well-known Member
Joined
Apr 30, 2002
Messages
1,579
Welcome!

There might be a more efficient way to do this but it will work.

Insert your checkbox that will lock/unlock the cell of interest(eg. A1)

Right click on the check box and select view code.

paste this code:
Code:
Private Sub CheckBox1_Click()

ActiveSheet.Unprotect

If CheckBox1 = True Then
    Sheets(1).Range("A1").Locked = False
Else
    Sheets(1).Range("A1").Locked = True
End If
    
ActiveSheet.Protect

End Sub

Copy the checkboxes and adjust "A1" as necessary for additional cells.

HTH,
Corticus
This message was edited by Corticus on 2002-10-22 10:35
 

Corticus

Well-known Member
Joined
Apr 30, 2002
Messages
1,579
Okay,

Daniel tried my code and Excel is warning everytime that the sheet is being protected. My Excel doesn't do this, it just locks and unlocks the cell as clicked. I only get a message if I try to type in the locked cell, which I want. Does anyone know how to disable this warning, I don't remember ever disabling it on my PC and I don't see anything in option???

BTW, what version of XL are you usig, I'm on 2000?

Corticus

edit:
lenze's way is probably better anyways
This message was edited by Corticus on 2002-10-22 11:03
 

Forum statistics

Threads
1,144,768
Messages
5,726,179
Members
422,660
Latest member
mrsteele

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top