Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
How can I code vba to determine if the selection change on a worksheet was
the result of pressing the ENTER key? |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
You can capture the key press of the enter key (note there are two enter
keys) something like this... With Application .OnKey "{Enter}", "MyMacro" .OnKey "~", "MyMacro" End With The macro MyMacro will have to mimic a normal enter but that is just seleting the cell you want... Check out this link... http://msdn.microsoft.com/library/de...HV05203370.asp -- HTH... Jim Thomlinson "joeeng" wrote: How can I code vba to determine if the selection change on a worksheet was the result of pressing the ENTER key? |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The problem is that I only want this to trigger on one worksheet, and only if
the {ENTER} results in an intersection with particular cells. I can't see how I can make the OnKey work for this circumstance. I might be missing something though. "Jim Thomlinson" wrote: You can capture the key press of the enter key (note there are two enter keys) something like this... With Application .OnKey "{Enter}", "MyMacro" .OnKey "~", "MyMacro" End With The macro MyMacro will have to mimic a normal enter but that is just seleting the cell you want... Check out this link... http://msdn.microsoft.com/library/de...HV05203370.asp -- HTH... Jim Thomlinson "joeeng" wrote: How can I code vba to determine if the selection change on a worksheet was the result of pressing the ENTER key? |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
I have figured out to accomplish this. Place the OnKey calls in the
beginning of the Worksheet_Activate and Worksheet_SelectionChange subroutines. Then reset the OnKeys in the Worksheet_Deactivate and at the end of the OnKey macros. "joeeng" wrote: The problem is that I only want this to trigger on one worksheet, and only if the {ENTER} results in an intersection with particular cells. I can't see how I can make the OnKey work for this circumstance. I might be missing something though. "Jim Thomlinson" wrote: You can capture the key press of the enter key (note there are two enter keys) something like this... With Application .OnKey "{Enter}", "MyMacro" .OnKey "~", "MyMacro" End With The macro MyMacro will have to mimic a normal enter but that is just seleting the cell you want... Check out this link... http://msdn.microsoft.com/library/de...HV05203370.asp -- HTH... Jim Thomlinson "joeeng" wrote: How can I code vba to determine if the selection change on a worksheet was the result of pressing the ENTER key? |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Determining the Cell Address of a VLOOKUP Result in VBA | Excel Discussion (Misc queries) | |||
Easily change Move selection after Enter option | Excel Discussion (Misc queries) | |||
how to change "move selection after enter" in office 2007 | Excel Discussion (Misc queries) | |||
Change from Column Selection to Cell Selection | Excel Programming | |||
Determining the Selection on a non-active Sheet? | Excel Programming |