Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Can a test to determine whether a workbook needs to be calculated beperformed?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 100
Default Can a test to determine whether a workbook needs to be calculated

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 968
Default Can a test to determine whether a workbook needs to be calculated be performed?

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   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 54
Default Can a test to determine whether a workbook needs to be calculated be performed?

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
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
How does t-test with unequal variance determine df? help me Excel Worksheet Functions 1 October 8th 08 08:38 PM
How do I determine if a workbook is a template? Clayman Excel Programming 2 July 6th 07 06:08 PM
Need macro to run when workbook is calculated Keith Excel Programming 1 February 4th 06 08:23 PM
Max sheets in a workbook or max # of calculated cells phil g Excel Discussion (Misc queries) 2 October 11th 05 09:49 PM
Can Excel2002 determine if a calculated date is a business day? jsmahnken Excel Worksheet Functions 2 September 26th 05 10:39 PM


All times are GMT +1. The time now is 02:58 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"