Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking cells
Is it possible to lock values onto cells right after they 've been entered?
|
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking cells
I mean is there something like an event like the loss of focus by the cell or
something like that? Thanks in advance |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking cells
Copy the following code into each sheet you want the rule to apply to
Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Locked < True Then If ActiveCell < "" Then ActiveSheet.Unprotect ActiveCell.Locked = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End If End If End Sub If I understand you correctly this should do the trick "João Costa" wrote in message ... I mean is there something like an event like the loss of focus by the cell or something like that? Thanks in advance |
#4
Posted to microsoft.public.excel.programming
|
|||
|
|||
Locking cells
Understand, that in using the SelectionChange feature, as you bounce around
the worksheet by selecting different areas, the cell(s) you leave will be forced to be locked if they are not entered. Might consider just the Change sub instead. Also if the user inadvertently hits a key and changes locations or enters the wrong data, you have to deal with that as well... "michael fuller" wrote: Copy the following code into each sheet you want the rule to apply to Private Sub Worksheet_SelectionChange(ByVal Target As Range) If ActiveCell.Locked < True Then If ActiveCell < "" Then ActiveSheet.Unprotect ActiveCell.Locked = True ActiveSheet.Protect DrawingObjects:=True, Contents:=True, Scenarios:=True End If End If End Sub If I understand you correctly this should do the trick "João Costa" wrote in message ... I mean is there something like an event like the loss of focus by the cell or something like that? Thanks in advance |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Locking everything except cells B4:B8 | New Users to Excel | |||
Locking Cells | Excel Discussion (Misc queries) | |||
Locking Cells | Excel Discussion (Misc queries) | |||
locking formula in cells in without locking whole sheet | Excel Discussion (Misc queries) | |||
Locking cells | Excel Programming |