Cell entry triggers Worksheet_SelectionChange event

D

Daniel.C

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
 
D

Daniel.C

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
 
P

Peter T

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top