generare a pause in a macro?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I have a macro that pulls info from a work book and then pastes it in to
another sheet, at this point I need the macro to stop running so that the
formula's I have in the sheet can update there cells before the macro resumes
and copy's the values from the updated cells and special pastes them to a
different sheet,

Currently the formulas are only running once the macro has stopped, and it
took me forever to figure this out!

Can anyone help? I really don't want to have to split the macro up in to two
separate ones

Can you help?
 
Use this anytime you want the formulas to update.

Application.calculate

HTH,
Paul
 
Look for "Application.ontime" in the VBA help.

This example from VBA help:

This runs a procedure 15 seconds from now.

Application.OnTime Now + TimeValue("00:00:15"), "my_Procedure"

HTH
Jo
 
You can call the .Calculate method yourself on a Range, Worksheet or
Application.
Do that after your initial paste and before the copy.

NickHK
 
it doesn't appere to work,

iv placed it just after where i paste the rows in and before i begin to copy
the in for over but its still not working the cells do not update,
 
this is what i have now:

is this correct? becase it still will not update

********************************
ActiveWindow.WindowState = xlMinimized
Windows("CR1137 Stats a.xls").Activate
ActiveWindow.WindowState = xlMaximized
ActiveSheet.Paste
ActiveSheet.Calculate
Range("E1").Select

Sheets("Totals").Select
Range("B3").Value = InputBox("What is your name?")

Sheets("data capture").Select
Range("H24").Select
Selection.Copy
Sheets("Totals").Select
Range("b4").Select
Selection.PasteSpecial Paste:=xlValues, Operation:=xlNone, SkipBlanks:= _
False, Transpose:=False
************************************
 
Does you code set the calculation mode to manual? Is so, set it back to
automatic at this time.

--
HTH

Bob Phillips

(replace somewhere in email address with gmail if mailing direct)
 
to be honest, im hashing through this making it up as i go along, my code is
a mix of bits or recorded macro and examples from online guides,

i have no idea where the calc would have been set to manual? how do i know?
 

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

Back
Top