.
Tools>>Options Edit Tab has a checkbox "Move Selection after Enter"
I have this disabled (Unchecked)
I have a sheet that I Sheet Protect, Select UnLocked Cells is Enabled, Select Locked Cells and All others are disabled.
A named range of Cells (E3:E122) named "PowerInput" are the only cells with Format Cell protection "not" locked.
With the above conditions, when I change a cell in the range "PowerInput" it moves the selection to the next cell even though the Tools>>Options Edit Tab checkbox "Move Selection after Enter" is disabled (Unchecked).
If, when protecting the sheet, Select Locked Cells is enabled, then this does not happen.
Is this by design or poor design? Is there a way to not move the selection after a cell in the "PowerInput" range is changed? I have code which runs based on the contents of a cell offset from the actice cell; if the selection moves then the wrong cell is input to code.
I could just leave Select Locked Cells disabled, but I like that paticular feature for this particular sheet.
my code for worksheet change:
Thanks, Chas
Tools>>Options Edit Tab has a checkbox "Move Selection after Enter"
I have this disabled (Unchecked)
I have a sheet that I Sheet Protect, Select UnLocked Cells is Enabled, Select Locked Cells and All others are disabled.
A named range of Cells (E3:E122) named "PowerInput" are the only cells with Format Cell protection "not" locked.
With the above conditions, when I change a cell in the range "PowerInput" it moves the selection to the next cell even though the Tools>>Options Edit Tab checkbox "Move Selection after Enter" is disabled (Unchecked).
If, when protecting the sheet, Select Locked Cells is enabled, then this does not happen.
Is this by design or poor design? Is there a way to not move the selection after a cell in the "PowerInput" range is changed? I have code which runs based on the contents of a cell offset from the actice cell; if the selection moves then the wrong cell is input to code.
I could just leave Select Locked Cells disabled, but I like that paticular feature for this particular sheet.
my code for worksheet change:
Code:
Private Sub Worksheet_Change(ByVal Target As Range)
Dim vrange As Range, cell As Range
Dim chas As Range
Set vrange = Range("PowerInput")
For Each cell In Target
If Union(cell, vrange).Address = vrange.Address Then
Set chas = ActiveCell.Offset(0, 4)
If chas = Range("AlertViolation") Then
frmViolation.Show
ElseIf chas = Range("AlertHold") Then
frmHold.Show
ElseIf chas = Range("AlertCaution") Then
frmCaution.Show
End If
End If
Next cell
End Sub
Thanks, Chas