?
Solved

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

Posted on 2013-05-10
3
Medium Priority
?
1,227 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:Murray Brown
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 85

Expert Comment

by:Rory Archibald
ID: 39160830
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 36

Accepted Solution

by:
Miguel Oz earned 2000 total points
ID: 39161269
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:Murray Brown
ID: 39162056
Thanks very much
0

Featured Post

Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Excel can be a tricky bit of software to get your head around. Whilst you’ll be able to eventually get to grips with the basic understanding of how to get by, there are a few Excel tips that not everybody will even know about let alone know how to d…
If you need to forecast numbers -- typically for finance -- the Windows and Mac versions of Excel 2016 have a basket of tools to get the job done.
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

719 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