Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 6
Default Infinite loop using Worksheet_Calculate

I'd like to update multiple cells using a Worksheet_Calculate code. My
problem is that the sheet is calculating after each one is updated and
triggers the macro again so it never stops. It works perfectly if I only
update one cell or switch to manual calculate. Is there any way around this?
  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 1,173
Default Infinite loop using Worksheet_Calculate

The worksheet_calculate event will fire, as it's name implies, everytime the
worksheet calculates. If you change a cell that has a dependency then it
will calculate.

Perhaps an explanation of what you are trying to do may help, as I believe a
worksheet_change event, which can control the cell(s) that are changing may
be a better way to go

--
HTH
Nick Hodge
Microsoft MVP - Excel
Southampton, England

HIS
www.nickhodge.co.uk

"Parker" wrote in message
...
I'd like to update multiple cells using a Worksheet_Calculate code. My
problem is that the sheet is calculating after each one is updated and
triggers the macro again so it never stops. It works perfectly if I only
update one cell or switch to manual calculate. Is there any way around
this?



  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 35,218
Default Infinite loop using Worksheet_Calculate

Maybe you can surround the code that causes calculation with:

application.enableevents = false
'whatever code you have
application.enableevents = true



Parker wrote:

I'd like to update multiple cells using a Worksheet_Calculate code. My
problem is that the sheet is calculating after each one is updated and
triggers the macro again so it never stops. It works perfectly if I only
update one cell or switch to manual calculate. Is there any way around this?


--

Dave Peterson
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Loop time seems dependent on unrelated workbook - Why? Richard Excel Worksheet Functions 2 March 30th 06 11:59 PM
For Next Infinite Loop Naji Excel Discussion (Misc queries) 5 January 13th 06 07:56 PM
Loop gone crazy Dave Peterson Excel Discussion (Misc queries) 4 December 16th 05 04:38 PM
Do Loop Noemi Excel Discussion (Misc queries) 0 December 8th 05 11:43 PM
hysteresis loop olivekim Charts and Charting in Excel 1 October 28th 05 04:22 AM


All times are GMT +1. The time now is 07:14 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"