Solved

VB.net/VSTO Excel Add-in Handle row deletion event

Posted on 2013-05-10
3
1,166 Views
Last Modified: 2013-05-13
Hi

I currently use the following event in my Excel VB.net Add-in to handle changes to cells.
How do I handle the deletion of Excel rows

Private Sub Application_SheetChange(Sh As Object, Target As Microsoft.Office.Interop.Excel.Range) Handles Application.SheetChange
0
Comment
Question by:murbro
3 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
Comment Utility
There is no event specifically for inserting or deleting rows. You can use a named range well below the data you expect and then monitor its row number when the target.columns.count = sheet.columns.count (which it has to if you are inserting / deleting rows). If the row number has decreased then a row has been deleted.
0
 
LVL 35

Accepted Solution

by:
Miguel Oz earned 500 total points
Comment Utility
As mentioned on previous post, Excel does not offer such event, but you can use the other events to monitor the number of deleted rows, for example check:
http://dailydoseofexcel.com/archives/2006/08/21/capture-deleted-rows/
0
 

Author Closing Comment

by:murbro
Comment Utility
Thanks very much
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

How to quickly and accurately populate Word documents with Excel data, charts and images (including Automated Bookmark generation) David Miller (dlmille) Synopsis In this article you’ll learn how to use ExcelToWord! to copy data,charts, shapes …
This article descibes how to create a connection between Excel and SAP and how to move data from Excel to SAP or the other way around.
Viewers will learn the basics of slicers and timelines for both PivotTables and standard Excel tables in Excel 2013.
The viewer will learn how to create a normally distributed random variable in Excel, use a normal distribution to simulate the return on an investment over a period of years, Create a Monte Carlo simulation using a normal random variable, and calcul…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now