How in Excel.Vba: detecting when a Table is being recalculated

M

MJ

I am using a function macro that takes quite a few seconds to calculate.

In addition, this worksheet perfoms time consuming operations on the
Worksheet_Calculate event, essentially for user-interface purposes.
It happens that these operations are not useful if they occur within a
table-recalculation.
Morevover these operations trigger new calculate events ... .

I would like to avoid these operations if a table is being recalculated.
This would be easy if I could detect that a table is being recalculated.
Do you know how I could do that?
 
G

Gary''s Student

First, in your calculate event code, set EnableEvents to False at the
beginning of the code and then back to True at the end of the code. This
prevents cascading events.

Second, it may be possilbe to control the re-calculation of tables. For
example, if the user is making entries or other interactions, you can set
calculation to Manual and only set it back to Automatic when appropriate.
 

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

Top