ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Is there a way to find out which cell has been altered? (https://www.excelbanter.com/excel-programming/338806-there-way-find-out-cell-has-been-altered.html)

DaveO

Is there a way to find out which cell has been altered?
 
The general idea is to run a macro when a cell changes.

I have figured out a workaround for now, using the Worksheet_Change object,
but is there any way to find out which cell has been altered?

We have Target as a ByVal, but thats the .value of the cell thats been
altered. How do I know the cell's reference?

TIA.

Jan Karel Pieterse

Is there a way to find out which cell has been altered?
 
Hi Dave,

We have Target as a ByVal, but thats the .value of the cell thats been
altered. How do I know the cell's reference?


Target *is* the changed cell(s), so Target.Address yields its address and
Target.Parent.Name gives you the name of the worksheet that cell lives
in.

Regards,

Jan Karel Pieterse
Excel MVP
http://www.jkp-ads.com


Norman Jones

Is there a way to find out which cell has been altered?
 
Hi Dave,

Try:

Target.Address

---
Regards,
Norman



"DaveO" wrote in message
...
The general idea is to run a macro when a cell changes.

I have figured out a workaround for now, using the Worksheet_Change
object,
but is there any way to find out which cell has been altered?

We have Target as a ByVal, but thats the .value of the cell thats been
altered. How do I know the cell's reference?

TIA.




Chip Pearson

Is there a way to find out which cell has been altered?
 
I'm not clear on what your question is. In the Worksheet_Change
event, the Target variable is the cell that is changed. I don't
understand what you mean by "How do I know the cell's
reference?". Target *is* the cell reference. Do you mean how to
get the address? If so,

Dim Addr As String
Addr = Target.Address

Could you be more specific about what exactly you are trying to
do?


--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com




"DaveO" wrote in message
...
The general idea is to run a macro when a cell changes.

I have figured out a workaround for now, using the
Worksheet_Change object,
but is there any way to find out which cell has been altered?

We have Target as a ByVal, but thats the .value of the cell
thats been
altered. How do I know the cell's reference?

TIA.




DaveO

Is there a way to find out which cell has been altered?
 
Guys, you;ve answered my question perfectly!!!

Thanks a lot.

"DaveO" wrote:

The general idea is to run a macro when a cell changes.

I have figured out a workaround for now, using the Worksheet_Change object,
but is there any way to find out which cell has been altered?

We have Target as a ByVal, but thats the .value of the cell thats been
altered. How do I know the cell's reference?

TIA.



All times are GMT +1. The time now is 05:41 AM.

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