Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default key press event?


i intend to programme code so that when the user presses spcae bar th
value in range J1 will go to the target cell i.e the one that space wa
pressed in a bit stuck so any help would be apprechiated thank

--
short_n_curl
-----------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...fo&userid=2157
View this thread: http://www.excelforum.com/showthread.php?threadid=38758

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 28
Default key press event?

I don't believe you can use the space bar because it starts to edit the
value of the cell.. However if you wanted to use the TAB key review the
code below. The reason I'm using the Workbook_Activate() portions is
becuase if the user has multiple workbooks open then the code will only
function if they are currently working on your workbook or else your
code will run for all open workbooks which you most likely don't want
to occur

Private Sub Workbook_Activate()
Call Workbook_SheetActivate(ActiveSheet)
End Sub

Private Sub Workbook_Deactivate()
Call Worksheet_Deactivate
End Sub

Private Sub Workbook_SheetActivate(ByVal Sh As Object)
If Sh.Name = "JournalEntry" Then
Application.OnKey "{TAB}", "MySub"
Else
Application.OnKey "{TAB}"
End If
End Sub

Private Sub Worksheet_Deactivate()
Application.OnKey "{TAB}"
End Sub

Private Sub MySub
' Your Code Here

End Sub

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default key press event?


ok i have tried this but....
the sheet i wish this code to activate with is singular and will onl
be on one workbook i will be the user and no other workbook will b
active, i need the cose to be in sheet94 and it has to be addressed t
sheet94 and not the name of the sheet as i have code that will chang
the sheet name with other events, if space cannot be used then can th
shift button?

thanks for the speedy responc

--
short_n_curl
-----------------------------------------------------------------------
short_n_curly's Profile: http://www.excelforum.com/member.php...fo&userid=2157
View this thread: http://www.excelforum.com/showthread.php?threadid=38758

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
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 1 August 10th 06 03:59 PM
how can I trap the change event (Tab Press key) of these controls Padam Excel Worksheet Functions 0 August 10th 06 02:41 PM
user form-on open event? keydown event? FSt1[_3_] Excel Programming 2 August 5th 04 02:26 PM
on press Fraggs[_18_] Excel Programming 1 June 7th 04 05:16 PM
OnTime event not firing in Workbook_Open event procedure GingerTommy Excel Programming 0 September 24th 03 03:18 PM


All times are GMT +1. The time now is 10:22 PM.

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"