Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
RaY RaY is offline
external usenet poster
 
Posts: 164
Default Key listener

Thank you for your reply, may I ask what the variable type would be if I use
activecell.address? As in Dim lastCell as xxx? And if I want to display
lastCell in a cell, how does it look like?

Thanks

Ray

"John Bundy" wrote:

Look up the onkey in vba help, you can do application.onkey"{tab}", *procedure*
and you can store the current cell to a variable with activecell.address

-John

"RaY" wrote:

Hi all,
I am trying to find out a way of keyboard listening code in the VBA section,
the reason I am doing so is because when a user have input a data in a cell,
either s/he will press TAB or ENTER. And I have got a code for working on the
same row, which press TAB would be fine but by pressing ENTER the code will
not work on the intended data. (Different people have different habits, so I
am just kind of user friendly to them :) )
Also, is there any way to remember the position of the current cell? Or
returning the cell position? It would be so helpful if I am updating a column
or row with hundards of data.

Many thanks!

Ray

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 27,285
Default Key listener

Demo'd from the immediate window:

? typename(activecell.Address)
String
? activecell.Address
$H$12
? activecell.Address(0,0,xlA1,true)
[Book1]Sheet4!H12

--
Regards,
Tom Ogilvy

"RaY" wrote in message
...
Thank you for your reply, may I ask what the variable type would be if I
use
activecell.address? As in Dim lastCell as xxx? And if I want to display
lastCell in a cell, how does it look like?

Thanks

Ray

"John Bundy" wrote:

Look up the onkey in vba help, you can do application.onkey"{tab}",
*procedure*
and you can store the current cell to a variable with activecell.address

-John

"RaY" wrote:

Hi all,
I am trying to find out a way of keyboard listening code in the VBA
section,
the reason I am doing so is because when a user have input a data in a
cell,
either s/he will press TAB or ENTER. And I have got a code for working
on the
same row, which press TAB would be fine but by pressing ENTER the code
will
not work on the intended data. (Different people have different habits,
so I
am just kind of user friendly to them :) )
Also, is there any way to remember the position of the current cell? Or
returning the cell position? It would be so helpful if I am updating a
column
or row with hundards of data.

Many thanks!

Ray



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



All times are GMT +1. The time now is 10:13 AM.

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"