Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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
Posted to microsoft.public.excel.programming
|
|||
|
|||
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 |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
how can I trap the change event (Tab Press key) of these controls | Excel Worksheet Functions | |||
how can I trap the change event (Tab Press key) of these controls | Excel Worksheet Functions | |||
user form-on open event? keydown event? | Excel Programming | |||
on press | Excel Programming | |||
OnTime event not firing in Workbook_Open event procedure | Excel Programming |