Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
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
  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 17
Default identifying a cell with worksheet_change

Thanks, Claus!
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identifying a cell/value in a table Ian Murdoch Excel Discussion (Misc queries) 5 August 1st 06 05:26 AM
Identifying the type of a Worksheet_Change Peter Rooney Excel Programming 6 January 17th 06 02:38 PM
Identifying the Selected Cell Warderbrad Excel Programming 2 November 23rd 05 04:21 PM
Identifying a cell that has changed [email protected] Excel Programming 4 September 14th 05 09:35 PM


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

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"