Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4
Default Keypress and "Enter" key

This is what I am trying to do:

For a given cell in column B I want to make a manual entry, e.g., in B10.
When I press return I want a VBA routine to run that will enter information
into the adjacent cell in column A, A10 in this case. KeyPress function
does not respond to the "event" of return being pressed. Is there a way to
detect the return or "Enter" key being pressed?

Thanks.

Thomas


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 292
Default Keypress and "Enter" key

Hi Thomas

No. But Enter completes a cell entry, and there's a useful event detecting
just that. Rightclick the sheet tab, choose View Code, paste this in:

Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "You wrote " & Target(1).Formula & _
" in " & Target(1).Address
End Sub

See Chip's page
http://www.cpearson.com/excel/events.htm
for theory on this.

HTH. best wishes Harald

"Thomas" skrev i melding
...
This is what I am trying to do:

For a given cell in column B I want to make a manual entry, e.g., in B10.
When I press return I want a VBA routine to run that will enter

information
into the adjacent cell in column A, A10 in this case. KeyPress function
does not respond to the "event" of return being pressed. Is there a way

to
detect the return or "Enter" key being pressed?

Thanks.

Thomas




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
Excel - Golf - how to display "-2" as "2 Under" or "4"as "+4" or "4 Over" in a calculation cell Steve Kay Excel Discussion (Misc queries) 2 August 8th 08 01:54 AM
Help!!! Enter "7" in a cell and Excel changes the "7" to "11" immediately!!! [email protected] Excel Discussion (Misc queries) 3 January 5th 07 02:18 PM
Make "Edit" mode default, rather than "Enter"? Greg Boettcher Excel Discussion (Misc queries) 1 July 27th 06 01:46 AM
Count occurences of "1"/"0" (or"TRUE"/"FALSE") in a row w. conditions in the next BCB New Users to Excel 7 May 13th 06 10:02 PM
How can I do convert letters on "*" using keypress on excel Daniel from Puerto Rico Excel Programming 1 June 27th 04 01:17 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"