Can a test to determine whether a workbook needs to be calculated beperformed?

B

Breck

I have a workbook that has manual calculation turned on. I need to run
a macro that only runs if the workbook needs to be calculated on the
active sheet.

I have found this code Application.CalculationVersion <>
activeworkbook.CalculationVersion that appears to perform this test
but it always returns a false value whether the calculation indicator
show calculate or not.
 
H

Howard31

Hi Breck,


I am not quite sure what you mean by "needs to be calculated", if you mean
that you have changed something on the sheet (because this is normaly the
time a sheet recalculates when in Automatic mode) then put whatever macro you
need to run in the Change event of the sheet *, or if you want the macro to
run on any sheet in the workbook then put the macro in Workbook code module
in the Sheet_Change event.**

Hope this helps.

* Private Sub Worksheet_Change(ByVal Target As Range)
MsgBox "Something has changed"
End Sub

**Private Sub Workbook_SheetChange(ByVal Sh As Object, ByVal Target As Range)
MsgBox "Something has changed"
End Sub
 

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