Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Set Enter Key movement in a particular sheet

Hi all,
I want to set direction for after pressing enter in a particular worksheet.
But when i open new or another files this should work as default as previous.

Is there any way.

Regards

Rao Ratan Singh
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Set Enter Key movement in a particular sheet

For simplicity's sake, we will keep all the code in one area: the Workbook's
code module. To put the code below into that area right-click on the Excel
icon just to the left of the word File in the main Excel menu toolbar and
choose [View Code] from the list that pops up. Copy and paste the code below
into it. Change the name of the special sheet within the two sections of
code where it is used.

you can use any of these as direction indicators:
xlToLeft
xlToRight
xlUp
xlDown

Now for the code:

Private Sub Workbook_Activate()
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
End If
End Sub

Private Sub Workbook_Deactivate()
Application.MoveAfterReturnDirection = xlDown ' back to default
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
Else
Application.MoveAfterReturnDirection = xlDown ' for all other sheets
End If
End Sub


"Rao Ratan Singh" wrote:

Hi all,
I want to set direction for after pressing enter in a particular worksheet.
But when i open new or another files this should work as default as previous.

Is there any way.

Regards

Rao Ratan Singh

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Set Enter Key movement in a particular sheet

Sir,
Thank lot for response. Bu i dont have good knowlege of macro and code, so
please me say how to put code in detail manner.



"JLatham" wrote:

For simplicity's sake, we will keep all the code in one area: the Workbook's
code module. To put the code below into that area right-click on the Excel
icon just to the left of the word File in the main Excel menu toolbar and
choose [View Code] from the list that pops up. Copy and paste the code below
into it. Change the name of the special sheet within the two sections of
code where it is used.

you can use any of these as direction indicators:
xlToLeft
xlToRight
xlUp
xlDown

Now for the code:

Private Sub Workbook_Activate()
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
End If
End Sub

Private Sub Workbook_Deactivate()
Application.MoveAfterReturnDirection = xlDown ' back to default
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
Else
Application.MoveAfterReturnDirection = xlDown ' for all other sheets
End If
End Sub


"Rao Ratan Singh" wrote:

Hi all,
I want to set direction for after pressing enter in a particular worksheet.
But when i open new or another files this should work as default as previous.

Is there any way.

Regards

Rao Ratan Singh

  #4   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 3,365
Default Set Enter Key movement in a particular sheet

Instructions for Excel 97/2000/XP (2002)/2003 [NOT for Excel 2007]
Open the workbook that the code needs to go into.
RIGHT-click on the Excel icon to the left of the word File in the Excel menu
toolbar.
Choose [View Code] from the list that will appear when you do that.
Copy the code I provided in the earlier message and paste it into the code
module presented to you (large white area in the VB Editor).
Close the VB Editor.
Save your workbook.
Close and open your workbook, and it should operate well for you.

If you would rather, you may send me a copy of your workbook as an email
attachment to (remove spaces from this address)
HelpFrom @ jlathamsite.com
and I will put the code into it, test it and return it to you.


"Rao Ratan Singh" wrote:

Sir,
Thank lot for response. Bu i dont have good knowlege of macro and code, so
please me say how to put code in detail manner.



"JLatham" wrote:

For simplicity's sake, we will keep all the code in one area: the Workbook's
code module. To put the code below into that area right-click on the Excel
icon just to the left of the word File in the main Excel menu toolbar and
choose [View Code] from the list that pops up. Copy and paste the code below
into it. Change the name of the special sheet within the two sections of
code where it is used.

you can use any of these as direction indicators:
xlToLeft
xlToRight
xlUp
xlDown

Now for the code:

Private Sub Workbook_Activate()
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
End If
End Sub

Private Sub Workbook_Deactivate()
Application.MoveAfterReturnDirection = xlDown ' back to default
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If ActiveSheet.Name = "SpecialSheetName" Then ' change sheet name as
required
Application.MoveAfterReturnDirection = xlToRight ' for this sheet only
Else
Application.MoveAfterReturnDirection = xlDown ' for all other sheets
End If
End Sub


"Rao Ratan Singh" wrote:

Hi all,
I want to set direction for after pressing enter in a particular worksheet.
But when i open new or another files this should work as default as previous.

Is there any way.

Regards

Rao Ratan Singh

  #5   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 107
Default Set Enter Key movement in a particular sheet

Sir,
I m using Excel 2007. I m sending you at you email id.

Thanks


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
Change Enter key movement in one workbook only Mike K Excel Discussion (Misc queries) 2 October 8th 07 06:11 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
Customize cursor movement when pressing enter User of the Word Excel Discussion (Misc queries) 3 May 8th 06 03:00 AM
how do i set the enter key to give a horizontal movement excel tricks Excel Worksheet Functions 1 December 9th 05 09:28 PM
Enter key movement direction Lowkey Setting up and Configuration of Excel 2 July 21st 05 05:40 PM


All times are GMT +1. The time now is 02:32 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"