LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default Worksheet specific code

I have a worksheet setup as a form where the user can enter data. I
allow the tab/right and shift+tab/left to navigate to the next and
previous cells where form data is to be filled in. However if the user
navigates to another worksheet or even workbook the changes are global.
How would I go about making the sub below specific to worksheet?

Private Sub Worksheet_SelectionChange(ByVal Target As Excel.Range)
If Target.Count 1 Then
Exit Sub
End If

Application.OnKey "{TAB}", "MoveNext"
Application.OnKey "{RIGHT}", "MoveNext"
Application.OnKey "+{TAB}", "MovePrev"
Application.OnKey "{LEFT}", "MovePrev"
End Sub

Thanks
Eric

 
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
Worksheet Specific Code Paul Excel Programming 2 March 9th 05 09:55 PM
HELP! Object specific Code dee Excel Programming 3 February 13th 05 07:16 PM
VB code to make Excel open in a specific worksheet OscarC Excel Programming 2 December 7th 04 09:57 PM
Code for new row and specific filling down Lucy[_2_] Excel Programming 1 June 23rd 04 11:44 AM
VBA code to open a specific worksheet MohK Excel Programming 2 October 29th 03 06:02 PM


All times are GMT +1. The time now is 06:59 AM.

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

About Us

"It's about Microsoft Excel"