View Single Post
  #19   Report Post  
Posted to microsoft.public.excel.programming
Bob Phillips Bob Phillips is offline
external usenet poster
 
Posts: 10,593
Default Mammoth Insert Formula


"Karen53" wrote in message
...
Bob, Thank you so much! I got it working. It's wonderful!

I had changed the location of the constant and missed changing it in a
location of the code.

I can't get over how great this works! Do you mind if I ask you some
questions? I would like to understand how you did this. Here's what I
think
you did.

You disabled the auto update, right?


I am not sure what you mean by that. It is still a worksheet change event,
so it is still trgiggered by a change to the DV cell.


You set the Target to the entire worksheet?


No. Target is a cell passed to the event procedure by Excel, and I test for
the Target being cell B33, exiting if not, continung if so.


After obtaining the last row you specified which cells you wanted to work
with and what you wanted done.


The code loops through cells B36:Blastrow and processes each dependent upon
what is in the DV cell.


Oh, I think I get it. By disabling the auto update you forced it to wait
for the change, right?


See above.


A question though, the application enable events have been disabled.
Where
are they enabled again? I see where they are enabled if there is an
error.
Yet they are enabled again as the worksheet does update when I make a
change.
Where does that happen?



They are enabled again after the ws_exit label. Events are disabled to stop
change event cascade, and if you notice, before disabling the events, I put
an error trap clause, which goes to ws_exit if there is an error. If an
error is encountered, the code branches to ws_exit, and so events get
re-enabled. If no error is encountered, the code still drops through to
ws_exit, and so events still get re-enabled.