View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
GB GB is offline
external usenet poster
 
Posts: 230
Default Identifying the type of a Worksheet_Change

Well, sounds like at least for the condition provided, (deletion of a row)
that you need to know how many rows contain data before and after the
deletion. If there is a difference in that number, then you don't want to
perform the actions of the macro. As for other structural changes, you would
still have the concern of moving a cell from one location to another, if a
cell containing say data A is moved to a cell that must contain data of
type/value B, then there would be a problem and you would most likely want
your macro run. One problem with this aspect, is that if you have determined
that number of rows, and this piece of data was the only item in the last
row, then by the comparison of number of rows, the validation would not be
run. *smirk* So definetly a trade off.



"Peter Rooney" wrote:

Good morning all,

Is there any way of identifying the type of a worksheet change.
I have such an event macro in a database that sets validation on cells in a
column, based on the value of the cell in the column to the left.
This works fine, but if I delete a row, .target doesn't have anything to act
on.
I need to be able to tell Excel to run the event macro if a change has been
made to a cell, but not to the structure of the workbook itself.

Is there any way in which I can do this?

I tried a condition with .target.cells.count, but this doesn't seem to be
quite what I need.

Thanks in advance

Pete