Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cell entry triggers Worksheet_SelectionChange event

4 views
Skip to first unread message

Daniel.C

unread,
Nov 21, 2009, 9:16:37 AM11/21/09
to
Tested in Excel 2003 fr, Excel 2007 fr, Excel 2010 beta en.
When you enter any character in a cell, the Worksheet_SelectionChange
event macro is fired (the target cell is still the active cell, no move
after entry).
Anyone heard of it ?
TIA
Daniel


Don Guillett

unread,
Nov 21, 2009, 9:24:49 AM11/21/09
to
code NOT restricted?
As ALWAYS, post your code for comments.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software
dguil...@austin.rr.com
"Daniel.C" <dcolard...@gmail.com> wrote in message
news:u4fO5Ura...@TK2MSFTNGP04.phx.gbl...

Daniel.C

unread,
Nov 21, 2009, 9:29:54 AM11/21/09
to
Just add the following macro to a sheet in a blank workbook :

Private Sub Worksheet_SelectionChange(ByVal Target As Range)
MsgBox "Selection change " & Target.Address
End Sub

Peter T

unread,
Nov 21, 2009, 9:34:19 AM11/21/09
to
That is normal. When you go into edit mode, then press Enter, the old active
cell is re-selected. If you programmatically change the value of a cell
(even re-apply the same value) only the 'Change' event will fire.

(There are one or two other programmatic actions which will trigger the
SelectionChange without doing anything at all to cells)

Regards,
Peter T

"Daniel.C" <dcolard...@gmail.com> wrote in message
news:u4fO5Ura...@TK2MSFTNGP04.phx.gbl...

Daniel.C

unread,
Nov 21, 2009, 9:41:35 AM11/21/09
to
Thanks. Good to know anyway, even if I can't think that it's normal.
Daniel
0 new messages