Home |
Search |
Today's Posts |
#1
Posted to microsoft.public.excel.programming
|
|||
|
|||
OnKey
I have a sheet with 3 cols by 40 rows, where the 1st col is for date, 2nd for
initials, and 3rd for comments. The comments can go for 80 chars at the max on one line. Then I would like to press resturn just to go down one row on the same column and continue the comment, etc. If SHIFT-RETURN ( OnKey+~) is pressed then the cursor should jump DOWN 1 row and LEFT twice. ( If Onkey = "+~" then {DOWN} {LEFT} {LEFT} Else {DOWN}) How can I accomplish that in VB? TIA Hernan |
#2
Posted to microsoft.public.excel.programming
|
|||
|
|||
OnKey
I don't think you can use the else:
Run Application.OnKey "+~" ThisWorkbook.TM" Where TM is a macro in the ThisWorkbook module: it should use SendKeys to send the keystrokes .. see the help files. Must be run as soon as your workbook opens .. see auto events in the help files. For the ELSE part, you might have to enumerate all the other keystrokes ... messy ... you might be betther of picking another keystroke for Sending the ELSE keystrokes. "Hernan" wrote: I have a sheet with 3 cols by 40 rows, where the 1st col is for date, 2nd for initials, and 3rd for comments. The comments can go for 80 chars at the max on one line. Then I would like to press resturn just to go down one row on the same column and continue the comment, etc. If SHIFT-RETURN ( OnKey+~) is pressed then the cursor should jump DOWN 1 row and LEFT twice. ( If Onkey = "+~" then {DOWN} {LEFT} {LEFT} Else {DOWN}) How can I accomplish that in VB? TIA Hernan |
#3
Posted to microsoft.public.excel.programming
|
|||
|
|||
OnKey
Right, else won't work, nor the rest of the line...
Forgetting the ELSE word, how would you write the code to express what I wrote (without the else part)? Thank you for your time. Hernan "AA2e72E" wrote: I don't think you can use the else: Run Application.OnKey "+~" ThisWorkbook.TM" Where TM is a macro in the ThisWorkbook module: it should use SendKeys to send the keystrokes .. see the help files. Must be run as soon as your workbook opens .. see auto events in the help files. For the ELSE part, you might have to enumerate all the other keystrokes ... messy ... you might be betther of picking another keystroke for Sending the ELSE keystrokes. "Hernan" wrote: I have a sheet with 3 cols by 40 rows, where the 1st col is for date, 2nd for initials, and 3rd for comments. The comments can go for 80 chars at the max on one line. Then I would like to press resturn just to go down one row on the same column and continue the comment, etc. If SHIFT-RETURN ( OnKey+~) is pressed then the cursor should jump DOWN 1 row and LEFT twice. ( If Onkey = "+~" then {DOWN} {LEFT} {LEFT} Else {DOWN}) How can I accomplish that in VB? TIA Hernan |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Help with using OnKey | Excel Programming | |||
OnKey Method | Excel Programming | |||
onkey help | Excel Programming | |||
onkey | Excel Programming | |||
Onkey | Excel Programming |