Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking Cells
How can I lock cells so that the info can't be changed. (So that they can't
even try if possible) Also is there a way that if I have A1 and E3 and the user needs to input data into A1 before they can input data into E3 I want to be able to lock E3 until A1 has info then Unlock E3 But if the user deletes the data in A1 then the data in E3 is also deleted. How can this be done? |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking Cells
By default, all of the cells are locked; you only need to protect the
worksheet. For the cells you don't want locked, Range("<range_address").Locked = False Then protect the worksheet, Worksheets("<worksheet_name").Protect Look in help for "Protect Method" for a list of parameters you can use with the Protect method. To Unprotect the worksheet, and make all cells editable again, Worksheets("<worksheet_name").UnProtect To set up a dependency between cells E3 and A1, do something like Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "") End Sub "Albert Mulder" wrote in message ... How can I lock cells so that the info can't be changed. (So that they can't even try if possible) Also is there a way that if I have A1 and E3 and the user needs to input data into A1 before they can input data into E3 I want to be able to lock E3 until A1 has info then Unlock E3 But if the user deletes the data in A1 then the data in E3 is also deleted. How can this be done? |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking Cells
Could someone explain this more, I don't get it. Sorry!
To set up a dependency between cells E3 and A1, do something like Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "") End Sub "Herrick Andrews" wrote: By default, all of the cells are locked; you only need to protect the worksheet. For the cells you don't want locked, Range("<range_address").Locked = False Then protect the worksheet, Worksheets("<worksheet_name").Protect Look in help for "Protect Method" for a list of parameters you can use with the Protect method. To Unprotect the worksheet, and make all cells editable again, Worksheets("<worksheet_name").UnProtect To set up a dependency between cells E3 and A1, do something like Private Sub Worksheet_SelectionChange(ByVal Target As Range) Cells(3, 5).Locked = (Trim(Cells(1, 1)) = "") End Sub "Albert Mulder" wrote in message ... How can I lock cells so that the info can't be changed. (So that they can't even try if possible) Also is there a way that if I have A1 and E3 and the user needs to input data into A1 before they can input data into E3 I want to be able to lock E3 until A1 has info then Unlock E3 But if the user deletes the data in A1 then the data in E3 is also deleted. How can this be done? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
locking cells | Excel Discussion (Misc queries) | |||
Locking everything except cells B4:B8 | New Users to Excel | |||
locking formula in cells in without locking whole sheet | Excel Discussion (Misc queries) | |||
Help on locking cells | Excel Discussion (Misc queries) | |||
Locking certain cells | Excel Worksheet Functions |