0
votes

am unable to identify the count and cell range of how many rows/columns are added or deleted in the excel worksheet using office.js

for example:

have 3 columns with 4 rows and this data is starting from B4 to D4, now the user has added 3 new empty rows on top of B4 hence my data has moved from B4: D4 to B7: D7.

Here I want to move back my data to starting position (i.e B4: D4) and delete the data at a new position (i.e B7: D7) even if the user add new rows or columns

am able to find the current range which is before any rows are cloumns are add/delete on top of my data(i.e B4:D4) but i am not able to identify the new cell range where my data is moved after any rows are columns are added.

1

1 Answers

0
votes

Try working with the WorksheetChanged event and the WorksheetChangedEventArgs class. The latter can report rowAdded and rowDeleted events and it also has a method for getting the range that has changed.