Infinite loop using Worksheet_Calculate

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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

(e-mail address removed)
www.nickhodge.co.uk
 
Maybe you can surround the code that causes calculation with:

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top