Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default VBA: Force wait until recalculate

Hi,

I've got a dashboard which is batch produced for all staff.

It works on the following principle:
1 Change member of staff
2 Copy sheets into a new file
3 Save new file with staff name

There's an assumed step 1b - I expect excel to recalculate its formulas
based on the name (lookups to queries etc), but recalculating takes a little
while.

I'm finding that it proceeds to step 2 (pastes the data out) before its done
the recalculation.

I understand there's a Calculate command in VBA, and wonder what I can add
to it to force everything to wait until the calculate process is 100%
complete.

Thanks in advance!

Tom.
  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 789
Default VBA: Force wait until recalculate

Hi
It may not work but try putting in the line
DoEvents

before the sheet copy code. I find a smattering of these in code helps
when there are screen refreshes or other graphic updates going on.
regards
Paul

On May 4, 10:04 am, mr tom <mr-tom at mr-tom.co.uk.(donotspam) wrote:
Hi,

I've got a dashboard which is batch produced for all staff.

It works on the following principle:
1 Change member of staff
2 Copy sheets into a new file
3 Save new file with staff name

There's an assumed step 1b - I expect excel to recalculate its formulas
based on the name (lookups to queries etc), but recalculating takes a little
while.

I'm finding that it proceeds to step 2 (pastes the data out) before its done
the recalculation.

I understand there's a Calculate command in VBA, and wonder what I can add
to it to force everything to wait until the calculate process is 100%
complete.

Thanks in advance!

Tom.



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default VBA: Force wait until recalculate

Thanks, Paul.

I've chucked in an Application.CalculateFull and that's currently being
tested.

DoEvents will be next.

Cheers,

Tom.

" wrote:

Hi
It may not work but try putting in the line
DoEvents

before the sheet copy code. I find a smattering of these in code helps
when there are screen refreshes or other graphic updates going on.
regards
Paul

On May 4, 10:04 am, mr tom <mr-tom at mr-tom.co.uk.(donotspam) wrote:
Hi,

I've got a dashboard which is batch produced for all staff.

It works on the following principle:
1 Change member of staff
2 Copy sheets into a new file
3 Save new file with staff name

There's an assumed step 1b - I expect excel to recalculate its formulas
based on the name (lookups to queries etc), but recalculating takes a little
while.

I'm finding that it proceeds to step 2 (pastes the data out) before its done
the recalculation.

I understand there's a Calculate command in VBA, and wonder what I can add
to it to force everything to wait until the calculate process is 100%
complete.

Thanks in advance!

Tom.




  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 119
Default VBA: Force wait until recalculate

The forced calculate did the job, but the Do Events would have done just as
well.

Cheers.

Tom.

"mr tom" wrote:

Thanks, Paul.

I've chucked in an Application.CalculateFull and that's currently being
tested.

DoEvents will be next.

Cheers,

Tom.

" wrote:

Hi
It may not work but try putting in the line
DoEvents

before the sheet copy code. I find a smattering of these in code helps
when there are screen refreshes or other graphic updates going on.
regards
Paul

On May 4, 10:04 am, mr tom <mr-tom at mr-tom.co.uk.(donotspam) wrote:
Hi,

I've got a dashboard which is batch produced for all staff.

It works on the following principle:
1 Change member of staff
2 Copy sheets into a new file
3 Save new file with staff name

There's an assumed step 1b - I expect excel to recalculate its formulas
based on the name (lookups to queries etc), but recalculating takes a little
while.

I'm finding that it proceeds to step 2 (pastes the data out) before its done
the recalculation.

I understand there's a Calculate command in VBA, and wonder what I can add
to it to force everything to wait until the calculate process is 100%
complete.

Thanks in advance!

Tom.




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
Force macro to wait with next step Gert-Jan[_2_] Excel Programming 1 December 20th 06 03:27 PM
How can I force my code to wait saita Excel Programming 2 September 30th 05 02:27 AM
Excel2000 VBA: How force the procedure to wait until queries are refreshed? Arvi Laanemets Excel Programming 2 June 16th 05 09:01 PM
Force Macro to wait till Refreshall is done NCSU_madman[_2_] Excel Programming 0 November 10th 04 05:36 PM
Force Macro to wait till Refreshall is done NCSU_madman Excel Programming 3 November 10th 04 04:39 PM


All times are GMT +1. The time now is 07:23 AM.

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

About Us

"It's about Microsoft Excel"