PC Review


Reply
Thread Tools Rate Thread

Challenge with Automatic Calculation

 
 
Michael R
Guest
Posts: n/a
 
      19th Jun 2009
My piece of code runs under manual calculation mode. When it is done I want
the whole lot to be recalculated.
Towards the end of my code I have the following statements:

With Application
.Calculation = xlAutomatic
.MaxChange = 0.001
End With

End Sub

The problem:
Watching the worksheet status in the right bottom corner of the screen I see
that the lot is calculated twice (the "Calculating xx%" runs from 0 to 100
twice) which is a bit of a nuisance since it takes quite a while.
How can I get it to calculate only once?
 
Reply With Quote
 
 
 
 
Gary''s Student
Guest
Posts: n/a
 
      19th Jun 2009
Rather than go to Automatic, try:

Sub MichaelR()
Application.CalculateFullRebuild
End Sub

--
Gary''s Student - gsnu200857


"Michael R" wrote:

> My piece of code runs under manual calculation mode. When it is done I want
> the whole lot to be recalculated.
> Towards the end of my code I have the following statements:
>
> With Application
> .Calculation = xlAutomatic
> .MaxChange = 0.001
> End With
>
> End Sub
>
> The problem:
> Watching the worksheet status in the right bottom corner of the screen I see
> that the lot is calculated twice (the "Calculating xx%" runs from 0 to 100
> twice) which is a bit of a nuisance since it takes quite a while.
> How can I get it to calculate only once?

 
Reply With Quote
 
Michael R
Guest
Posts: n/a
 
      19th Jun 2009
Thank you very much, works fine - and calculates only once.

"Gary''s Student" wrote:

> Rather than go to Automatic, try:
>
> Sub MichaelR()
> Application.CalculateFullRebuild
> End Sub
>
> --
> Gary''s Student - gsnu200857
>
>
> "Michael R" wrote:
>
> > My piece of code runs under manual calculation mode. When it is done I want
> > the whole lot to be recalculated.
> > Towards the end of my code I have the following statements:
> >
> > With Application
> > .Calculation = xlAutomatic
> > .MaxChange = 0.001
> > End With
> >
> > End Sub
> >
> > The problem:
> > Watching the worksheet status in the right bottom corner of the screen I see
> > that the lot is calculated twice (the "Calculating xx%" runs from 0 to 100
> > twice) which is a bit of a nuisance since it takes quite a while.
> > How can I get it to calculate only once?

 
Reply With Quote
 
Michael R
Guest
Posts: n/a
 
      22nd Jun 2009

Unfortunately I have now discovered a challenge with the ...Rebuild:

When I save, close and re-open the workbook I get a "Excel found unreadable
content in Workbook". When I agree to having it repaired some of my formulae
are being replaced by "=#N/A". The odd thing is that the original (identical)
formulae above and below the "problem-cell" are OK. The workbook is too large
to do a comprehensive check whether these N/As are the only resulting issues.

I have tried to narrow the problem down and found that it appears to be the
Rebuild which results in this situation. I have tried
"Application.CalculateFull" and "Application.Calculate" and neither of them
creates the problem.

Do you have any clue what the root-cause might be - and how to fix it?

Thanks for your help,
Michael

"Gary''s Student" wrote:

> Rather than go to Automatic, try:
>
> Sub MichaelR()
> Application.CalculateFullRebuild
> End Sub
>
> --
> Gary''s Student - gsnu200857
>
>
> "Michael R" wrote:
>
> > My piece of code runs under manual calculation mode. When it is done I want
> > the whole lot to be recalculated.
> > Towards the end of my code I have the following statements:
> >
> > With Application
> > .Calculation = xlAutomatic
> > .MaxChange = 0.001
> > End With
> >
> > End Sub
> >
> > The problem:
> > Watching the worksheet status in the right bottom corner of the screen I see
> > that the lot is calculated twice (the "Calculating xx%" runs from 0 to 100
> > twice) which is a bit of a nuisance since it takes quite a while.
> > How can I get it to calculate only once?

 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
Date Calculation Challenge =?Utf-8?B?Um9zZQ==?= Microsoft Access Database Table Design 3 1st Oct 2006 10:05 PM
Calculation Challenge =?Utf-8?B?Um9zZQ==?= Microsoft Access Queries 3 1st Oct 2006 03:13 AM
Date Calculation Programming Challenge =?Utf-8?B?Um9zZQ==?= Microsoft Access VBA Modules 2 30th Sep 2006 02:46 PM
Loan Calculation Challenge Stephen Lynch Microsoft Access Queries 1 17th Feb 2005 07:50 PM
Utilization calculation challenge Herb Wagner Microsoft Excel Worksheet Functions 2 31st Jul 2004 09:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 10:31 PM.