View Single Post
  #1   Report Post  
Posted to microsoft.public.excel.programming
[email protected] c1802362@cox.net is offline
external usenet poster
 
Posts: 17
Default identifying a cell with worksheet_change

I'm trying to return the cell address of the cell a user changes on a sheet.

For example, if I want to capture changes on Sheet1, I put this code in the Sheet1 object:


Private Sub Worksheet_Change(ByVal Target As Range)

MsgBox ActiveCell.Address

End Sub


If the user changes cell A1, I get two possible outcomes:

* if the checkmark is clicked in the formula bar (no tab or return), I get $A$1 (the correct address)

* if the user changes the cell and hits the return key, the response is $B$1

Obviously, the returned address is of the cell that is active after the return, not necessarily the one that was changed.

So, what is the correct way to code this so that the cell that is changed is the address that is returned?

Art