View Single Post
  #8   Report Post  
Posted to microsoft.public.excel,microsoft.public.excel.misc,microsoft.public.excel.programming
Jake Marx[_3_] Jake Marx[_3_] is offline
external usenet poster
 
Posts: 860
Default Changing the contents of a cell... dynamically?

Hi Shatin,

Yes, you only entered the value once, but you are changing the Value
property via VBA code (which triggers the subroutine just as if you had
changed the value yourself). If you don't use EnableEvents=False, then the
event routine will keep getting triggered until Excel figures out it's in an
endless loop and stops.

Example:

1) You enter 10 -- this triggers the subroutine
2) the subroutine changes the value to 75 -- this triggers the subroutine
again
3) the subroutine changes the value to 50 -- this triggers the subroutine
again
....

So you see, without disabling built-in application events, Excel will get
stuck in an endless loop of updating the value over and over.

--
Regards,

Jake Marx
MS MVP - Excel
www.longhead.com

[please keep replies in the newsgroup - email address unmonitored]


Shatin wrote:
Sorry, Frank. I still don't understand this. You wrote:

quite easy. Without this line each time you change the cell A10 the
event gets triggered again.


Not quite sure what you mean by "each time" becaue I only entered the
value into A10 just once but the value has jumped to 5500 already.