ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Cell entry triggers Worksheet_SelectionChange event (https://www.excelbanter.com/excel-programming/436473-cell-entry-triggers-worksheet_selectionchange-event.html)

Daniel.C[_3_]

Cell entry triggers Worksheet_SelectionChange event
 
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

Cell entry triggers Worksheet_SelectionChange event
 
code NOT restricted?
As ALWAYS, post your code for comments.

--
Don Guillett
Microsoft MVP Excel
SalesAid Software

"Daniel.C" wrote in message
...
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




Daniel.C[_3_]

Cell entry triggers Worksheet_SelectionChange event
 
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

code NOT restricted?
As ALWAYS, post your code for comments.




Peter T

Cell entry triggers Worksheet_SelectionChange event
 
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" wrote in message
...
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





Daniel.C[_3_]

Cell entry triggers Worksheet_SelectionChange event
 
Thanks. Good to know anyway, even if I can't think that it's normal.
Daniel

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" wrote in message
...
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






All times are GMT +1. The time now is 07:21 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com