Detect Delete Column/Row vs Insert
Excel 2002, WinXP
I am helping an OP and I have run into something that I need some help with.
His file has some key words located here and there that some code I wrote is
using to locate things. No problem with that.
His problem is that his user might delete a column/row that contains one or
more of these key words, and thereby mess up the operation of the code. His
user is permitted to delete/insert columns and rows and does so.
So I wrote him some code based on a Worksheet_Change macro and Undo and
check for those words, etc. That works fine.
But I didn't consider that this code will fire when the user INSERTS a
column/row as well. That results in bad things happening.
My question: Is there any way to detect that the change (Worksheet_Change)
was an insertion rather than a deletion of a column/row?
Thanks for your help. Otto
|