View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
David David is offline
external usenet poster
 
Posts: 2
Default Selection the previously selected cell

I would like to know how to select the previously selected
cell in Excel using VBA code.

I am using the Worksheet_Change event to validate values
entered, using IF statements in VBA.

This works fine as long as the value is entered using the
enter key, as the active cell does not change. However,
if a value is entered using any of the arrow keys, the
active cell changes and the wrong cell is validated!

When the Worksheet_Change event is triggered I want to be
able to return to the cell into which the value has been
entered, regardless of which key has been used to enter
it. I still want to be able to use the arrow keys to move
about the worksheet.

Can anyone help?