ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Insert Row Event (https://www.excelbanter.com/excel-programming/431557-insert-row-event.html)

miroslj

Insert Row Event
 
I need to catch when the new Rows are inserted or existing rows are Deleted
into the Sheet1.
And When this happed to insert the new Rows in Sheet2
at the same position (with the same row number).

But all that I find is event Worksheet_Change,
and I can not make difference using this event if
the new Rows are inserted or existing rows are Deleted
OR just Copy(rows) command.


joel

Insert Row Event
 
The only way you can do it is to compare the number of rows og data on each
sheet to determine when they don't match. You also need some column that has
unique values in each row (line an ID number) so you can determine where the
new row was added or deleted.

"miroslj" wrote:

I need to catch when the new Rows are inserted or existing rows are Deleted
into the Sheet1.
And When this happed to insert the new Rows in Sheet2
at the same position (with the same row number).

But all that I find is event Worksheet_Change,
and I can not make difference using this event if
the new Rows are inserted or existing rows are Deleted
OR just Copy(rows) command.


Atishoo

Insert Row Event
 
You could insert a command button or button on custom toolbar that would
trigger a sub to insert a column into both worksheets at the same time.

"miroslj" wrote:

I need to catch when the new Rows are inserted or existing rows are Deleted
into the Sheet1.
And When this happed to insert the new Rows in Sheet2
at the same position (with the same row number).

But all that I find is event Worksheet_Change,
and I can not make difference using this event if
the new Rows are inserted or existing rows are Deleted
OR just Copy(rows) command.



All times are GMT +1. The time now is 11:39 AM.

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