If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > PC based Database Applications > Microsoft Excel > Application.OnKey

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 07-21-04, 10:39
Alexxx12 Alexxx12 is offline
Registered User
 
Join Date: Sep 2002
Location: NJ
Posts: 139
Application.OnKey

Hi,

Excel 97

I have written a small excel program that works well in sheet one, but when I got to sheet two, it does not work.

I have these lines in all sheets Activate events and when I load the workbook, sheet one works, but sheet two and three don't. Any thoughts?

Private Sub Worksheet_Activate()
Application.OnKey "{Return}"
Application.OnKey "{Enter}", "AMPM"

End Sub

Private Sub Worksheet_Deactivate()
Application.OnKey "{Return}"
Application.OnKey "{Enter}"
End Sub
Reply With Quote
  #2 (permalink)  
Old 07-22-04, 03:41
starsky51 starsky51 is offline
Registered User
 
Join Date: Feb 2002
Posts: 8
Use the Workbook (ThisWorkbook) object instead of the Worksheet. You can use the workbook functions "SheetActivate" and "SheetDeactivate" to perform the action on all sheets in the book.

Dave.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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