#1   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Enter Key

We can use ToolsOptionsEditDirection to control the behaviour of the
Enter Key, but is there a way to have the Enter Key stay in the same cell?

I have removed the check mark from "Move Selection after Enter" to no
avail.

Thanks,
Bernie
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,173
Default Enter Key

Bernie

Unchecking should do it but...

You can certainly set this via code. This could either be in the workbooks
open even or you could use it as a toolbar button and toggle it on/off (as
per the code sample)

Sub moveAfterReturnNo()
If Application.MoveAfterReturn = False Then
Application.MoveAfterReturn = xlDown
Exit Sub
End If
Application.MoveAfterReturn = False
End Sub

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England
HIS


"bw" wrote in message news:opsesoiborvzdmg1@bw...
We can use ToolsOptionsEditDirection to control the behaviour of the
Enter Key, but is there a way to have the Enter Key stay in the same cell?

I have removed the check mark from "Move Selection after Enter" to no
avail.

Thanks,
Bernie



  #3   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Enter Key

Thanks, Nick!

For some reason, "Unchecking" now works??? In any case, I appreciate the
code, and I'll save it for possible later use.

Bernie

On Thu, 23 Sep 2004 20:54:05 +0100, Nick Hodge
wrote:

Bernie

Unchecking should do it but...

You can certainly set this via code. This could either be in the
workbooks
open even or you could use it as a toolbar button and toggle it on/off
(as
per the code sample)

Sub moveAfterReturnNo()
If Application.MoveAfterReturn = False Then
Application.MoveAfterReturn = xlDown
Exit Sub
End If
Application.MoveAfterReturn = False
End Sub


  #4   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Enter Key

Nick,

I discovered why "Unchecking" didn't work. The Sheet is Protected, and
"Unchecking" doesn't work when the sheet is protected.

Also, "If ActiveSheet.Protect = True Then" is always False.

Do you have a solution to this problem?

Thanks,
Bernie

On Thu, 23 Sep 2004 20:54:05 +0100, Nick Hodge
wrote:

Bernie

Unchecking should do it but...

You can certainly set this via code. This could either be in the
workbooks
open even or you could use it as a toolbar button and toggle it on/off
(as
per the code sample)

Sub moveAfterReturnNo()
If Application.MoveAfterReturn = False Then
Application.MoveAfterReturn = xlDown
Exit Sub
End If
Application.MoveAfterReturn = False
End Sub


  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Enter Key

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.

--
Regards,
Tom Ogilvy


"bw" wrote in message news:opsessf8zmvzdmg1@bw...
Nick,

I discovered why "Unchecking" didn't work. The Sheet is Protected, and
"Unchecking" doesn't work when the sheet is protected.

Also, "If ActiveSheet.Protect = True Then" is always False.

Do you have a solution to this problem?

Thanks,
Bernie

On Thu, 23 Sep 2004 20:54:05 +0100, Nick Hodge
wrote:

Bernie

Unchecking should do it but...

You can certainly set this via code. This could either be in the
workbooks
open even or you could use it as a toolbar button and toggle it on/off
(as
per the code sample)

Sub moveAfterReturnNo()
If Application.MoveAfterReturn = False Then
Application.MoveAfterReturn = xlDown
Exit Sub
End If
Application.MoveAfterReturn = False
End Sub






  #6   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
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).

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.


  #7   Report Post  
Posted to microsoft.public.excel.programming
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.




  #8   Report Post  
Posted to microsoft.public.excel.programming
bw bw is offline
external usenet poster
 
Posts: 74
Default Enter Key

I don't understand why you can make it work, and I can't?

I format cells A1:A3 as "Unlocked", then when I Protect the Sheet and
"Select Unlocked Cells" only.

I then uncheck "Move selection on Enter".

When I enter information into cell A1 and press Enter, the focus moves to
Cell A2.

Again, I don't understand why you can make it work, and I can't?

Bernie


On Thu, 23 Sep 2004 22:18:39 -0400, Tom Ogilvy wrote:

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.


  #9   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Enter Key

I could reproduce the behavior if I set the enableselection property of the
worksheet to xlUnlockedCells. If no restriction, it worked as expected.

--
Regards,
Tom Ogilvy

"bw" wrote in message news:opsetw76k7vzdmg1@bw...
I don't understand why you can make it work, and I can't?

I format cells A1:A3 as "Unlocked", then when I Protect the Sheet and
"Select Unlocked Cells" only.

I then uncheck "Move selection on Enter".

When I enter information into cell A1 and press Enter, the focus moves to
Cell A2.

Again, I don't understand why you can make it work, and I can't?

Bernie


On Thu, 23 Sep 2004 22:18:39 -0400, Tom Ogilvy wrote:

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.




Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Macro to select cells in column enter data then press enter NP New Users to Excel 1 February 20th 08 04:21 PM
Enter multiple numbers in a cell so total shows when enter keypres newbie Excel Worksheet Functions 2 August 19th 07 12:23 PM
Enter info in one sheet, auto enter in another based on one field The BusyHighLighter[_2_] New Users to Excel 1 August 1st 07 10:54 PM
Auto enter date when data in enter in another cell Brian Excel Worksheet Functions 5 December 7th 06 06:44 PM
What does hitting Ctrl + Shift + Enter to enter a formula do??? Help a n00b out. qwopzxnm Excel Worksheet Functions 2 October 20th 05 09:06 PM


All times are GMT +1. The time now is 04:12 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"