ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Determine if cell was modified by Enter , Paste or Delete (https://www.excelbanter.com/excel-programming/328499-determine-if-cell-modified-enter-paste-delete.html)

Randy

Determine if cell was modified by Enter , Paste or Delete
 

--
Randy

Hi, I am having trouble getting the row number of the cell just modified.

If Copy/Paste is used, ActiveCell.Row gives the correct answer. If the cell
was cleared with the DEL key, again AC.Row is correct. Problem is the if the
cell was modified and then ENTER is hit, AC.Row now gives me the next row
number. I need to know the real row that was modified so I can do some stuff
to other cells on that row. This is probably easy but I can't find it.

Thanks.

Tom Ogilvy

Determine if cell was modified by Enter , Paste or Delete
 
You can look at the change event. The Target argument is a reference to the
cell that triggered the event.

http://www.cpearson.com/excel/events.htm
Chip Pearson's page with an overview on events.

--
Regards,
Tom Ogilvy

"Randy" wrote in message
...

--
Randy

Hi, I am having trouble getting the row number of the cell just modified.

If Copy/Paste is used, ActiveCell.Row gives the correct answer. If the

cell
was cleared with the DEL key, again AC.Row is correct. Problem is the if

the
cell was modified and then ENTER is hit, AC.Row now gives me the next row
number. I need to know the real row that was modified so I can do some

stuff
to other cells on that row. This is probably easy but I can't find it.

Thanks.




David

Determine if cell was modified by Enter , Paste or Delete
 
Hi,
I suspect your Tools/Options/Edit/Move After Enter is set to move down after
you have entered data, so the active row is below the place you entered the
data. That can be changed.
Thanks,

"Randy" wrote:


--
Randy

Hi, I am having trouble getting the row number of the cell just modified.

If Copy/Paste is used, ActiveCell.Row gives the correct answer. If the cell
was cleared with the DEL key, again AC.Row is correct. Problem is the if the
cell was modified and then ENTER is hit, AC.Row now gives me the next row
number. I need to know the real row that was modified so I can do some stuff
to other cells on that row. This is probably easy but I can't find it.

Thanks.


Randy

Determine if cell was modified by Enter , Paste or Delete
 

--
Randy


"David" wrote:

Hi,
I suspect your Tools/Options/Edit/Move After Enter is set to move down after
you have entered data, so the active row is below the place you entered the
data. That can be changed.
Thanks,

"Randy" wrote:


--
Randy

Hi, I am having trouble getting the row number of the cell just modified.

If Copy/Paste is used, ActiveCell.Row gives the correct answer. If the cell
was cleared with the DEL key, again AC.Row is correct. Problem is the if the
cell was modified and then ENTER is hit, AC.Row now gives me the next row
number. I need to know the real row that was modified so I can do some stuff
to other cells on that row. This is probably easy but I can't find it.

Thanks.


yes, that is the way the options are set but i really want them that way. a
previous post suggests using Target.Row instead of ActiveCell.Row or
Selection.Row
Tried this and I does exactly what I want. Thanks all.


All times are GMT +1. The time now is 10:23 PM.

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