Capturing deletion of a row

  • Thread starter Thread starter Glen Mettler
  • Start date Start date
G

Glen Mettler

How can I tell if a user has deleted a row?

I need to recal certain cells but only if the user has deleted one or more
rows. I have a macro in the SheetChange event that executes every time
there is a change to a worksheet. I need it to execute onloy if the user
has deleted a row.

Glen
 
Maybe store the counta( in a cell somewhere and have the event do an
immediate counta and react if the two don't match??
 
Problem solved
I created a public variable RowCount
The in the ActivateSheet event I count the rows
RowCount=cells(rows.count,1).end(xlup).row

Then in the SheetChange event
I count the rows again and compare it to RowCount. If the user has added or
deleted a row I update RowCount and then run the recalc, otherwise I exit
the sub

Glen
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top