Findjjing the range that triggered worksheet calculate

  • Thread starter Thread starter Chick
  • Start date Start date
C

Chick

I am using Excel 97.
I use VBA to populate 2 cells with values.
When these cells are populated two adjacent cells containing formulas
trigger the worksheet calculate event. I do not want this to happen.

I have tried using application.caller..

Select Case TypeName(Application.Caller)
Case "Range"
v = Application.Caller.Address
Case "String"
v = Application.Caller
Case "Error"
v = "Error"
Case Else
v = "unknown"
End Select
MsgBox "caller = " & v

But it always returns "Error"

Is there another way to find out what is triggering the worksheet
calculate?
 
There is no general way of finding out which formulae or events have
triggered a recalculation.

If you want to stop the recalculation then either
- switch calculation to manual
- make sure that no formulae refer to the cells you are populating


regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm
 
Hi
before inserting the values ypu may add the line
application.enableevents = false

and after the insertion:
application.enableevents = true
 
Note that setting enablevents to false will prevent the worksheet calculate
event from being called but if you are in automatic mode the formulae will
still be recalculated.


regards
Charles
______________________
Decision Models
FastExcel Version 2 now available.
www.DecisionModels.com/FxlV2WhatsNew.htm
 

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