#1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default 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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 103
Default 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
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
Help with using OnKey keithb Excel Programming 1 December 19th 05 11:03 PM
OnKey Method cottage6 Excel Programming 1 October 20th 04 05:56 PM
onkey help wardy Excel Programming 0 July 20th 04 05:49 PM
onkey peter Excel Programming 2 March 2nd 04 07:34 PM
Onkey Jase Excel Programming 1 November 17th 03 11:07 PM


All times are GMT +1. The time now is 10:30 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"