Updating Calculations in excel other than using F9

seljo

New Member
Joined
Sep 29, 2006
Messages
12
Is there anyway I can automatically update a wookbook in excel automatically every minute or so or am I stuck with hiting the F9 key every time I want it updated.

Thanks
 

Excel Facts

How can you automate Excel?
Press Alt+F11 from Windows Excel to open the Visual Basic for Applications (VBA) editor.

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
Try
Code:
Dim NextTime As Date
Sub RepeatOneSec()
    Application.Calculate
    NextTime = Now() + TimeSerial(0, 0, 1)
    Application.OnTime NextTime, "RepeatOneSec"
    End Sub
Sub EndProcess()
    Application.OnTime NextTime, "RepeatOneSec", , False
End Sub
 

seljo

New Member
Joined
Sep 29, 2006
Messages
12
I am very new to all of this so forgive me if I ask a stupid question. This is a Macro, correct, so when I want this to run I go under Macros run and it should execute, correct. For some reason I keep geting an error message stating the the file is not found. Any help would be great, forgive me for my ignorance I am just learning.

Thanks
 

VoG

Legend
Joined
Jun 19, 2002
Messages
63,650
In your worksheet press ALT + F11 to open the Visual Basic Editor. Insert Module then copy the following code (note: I amended it)

Code:
Dim NextTime As Date
Sub RepeatOneMin()
    Application.Calculate
    NextTime = Now() + TimeSerial(0, 1, 0)
    Application.OnTime NextTime, "RepeatOneMin"
End Sub
Sub EndProcess()
    Application.OnTime NextTime, "RepeatOneMin", , False
End Sub

and paste it in. Close the VBE. Tools > Macro > Macros, Click on RepeatOneMin then click the Run button. This should calculate once per minute. To stop it Tools > Macro > Macros, Click on EndProcess and click the Run button.
 

Forum statistics

Threads
1,141,681
Messages
5,707,796
Members
421,528
Latest member
datdude151

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Top