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

How to fill five years of quarters?
Type 1Q-2023 in a cell. Grab the fill handle and drag down or right. After 4Q-2023, Excel will jump to 1Q-2024. Dash can be any character.
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
 
Upvote 0
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
 
Upvote 0
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
 
Upvote 0

Forum statistics

Threads
1,214,426
Messages
6,119,417
Members
448,895
Latest member
omarahmed1

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
Back
Top