Thread: Enter Key
View Single Post
  #7   Report Post  
Posted to microsoft.public.excel.programming
Tom Ogilvy Tom Ogilvy is offline
external usenet poster
 
Posts: 27,285
Default Enter Key

Thanks for the information, Tom, but when the sheet is PROTECTED, and
"Move Selection after Enter" is NOT checked, the Enter Key Moves to a
different cell (Right, Left, Down, or Up...whichever was last selected).


I couldn't reproduce that behavior. When I unchecked it and edited an
unlocked cell (protected sheet), when I hit enter, the highlight did not
move. Maybe it isn't clear what you are saying.

--
Regards,
Tom Ogilvy



"bw" wrote in message news:opses6c3b8vzdmg1@bw...
Thanks for the information, Tom, but when the sheet is PROTECTED, and
"Move Selection after Enter" is NOT checked, the Enter Key Moves to a
different cell (Right, Left, Down, or Up...whichever was last selected).

You don't need code to verify the statement above.

But still, I have the following code anyway (now), and it doesn't work
either.

Sub NoMoveAfterReturn()
If ActiveSheet.ProtectContents = True Then 'PROTECTED
ActiveSheet.Unprotect
Application.MoveAfterReturn = False
ActiveSheet.Protect DrawingObjects:=True, Contents:=True,
Scenarios:=True
ActiveSheet.EnableSelection = xlUnlockedCells
Else 'UNPROTECTED
Application.MoveAfterReturn = False
End If
End Sub

I'm still looking for a suggestion that will work when the sheet is
protected.

Thanks,
Bernie


On Thu, 23 Sep 2004 21:00:50 -0400, Tom Ogilvy wrote:

When you do Tools=Protect=worksheet, you have 3 choices. So there are
three properties to check (plus there is one more property that can be
protected, but only with code).

Worksheet object properties:
protectionMode
protectContents
protectscenarios
protectDrawingObjects

if any of them are true, then the sheet is protected.