Home |
Search |
Today's Posts |
|
#1
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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. |
#2
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
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 -- A. Ch. Eirinberg "Breck" wrote: 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. |
#3
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Try Application.CalculationState
Charles ___________________________________ The Excel Calculation Site http://www.decisionmodels.com "Breck" wrote in message ... 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. |
#4
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
Thanks works like a charm
"Charles Williams" wrote in message ... Try Application.CalculationState Charles ___________________________________ The Excel Calculation Site http://www.decisionmodels.com "Breck" wrote in message ... 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. |
Reply |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
How does t-test with unequal variance determine df? | Excel Worksheet Functions | |||
How do I determine if a workbook is a template? | Excel Programming | |||
Need macro to run when workbook is calculated | Excel Programming | |||
Max sheets in a workbook or max # of calculated cells | Excel Discussion (Misc queries) | |||
Can Excel2002 determine if a calculated date is a business day? | Excel Worksheet Functions |