Setting a Workbook Calculation timing

dikken20

Board Regular
Joined
Feb 25, 2009
Messages
130
Office Version
  1. 2010
Platform
  1. Windows
Hello,

My sheet contains links from a third application and it's set to Automatic calculation.
New data retrieved every few seconds so I should get the data every second or close to it (One of the fields the sheet retrieved is "time" so I can know how updated is that data).

Yet, I found that the data is updated every 3 minutes (and more..) rather than every second or few seconds.
I changed the Automatic calculation to Manual calculation, Results: Every click on the Calculate Now results with a "new updated" data which is indeed updated from a few seconds ago rather than 3 minutes, like it should be in the first place.

I suppose that the Automatic calculation has an algorithm to decide when to calculate and that algorithm doesn't go into my favor,
So how can I set the sheet calculation to be immediate or at least to be every second or so?
 
Setup is the sheet name. In my workbooks, all my global variables can be changed by the end user to control the macros. You are correct, TimerStatus is the cell where you input true or false to control the update. The macro I gave you is an example of how to control the OnTime. If you need to control separate updates, then I suggest you add some more named ranges on the Setup sheet to control each one. In the "DoTheUpdate" function you can test each of those variables to see if they need to be run.

How did the Update macro you had previously created operate? Did it have code for running separate sheets? If that code is in one Subroutine, then you may want to split it out into different SUBS so you can test the variables you added to the setup sheet and run individually. Or test for each variable in the same SUB, up to you.

I'm afraid it didn't really changed the same situation :(
 
Upvote 0

Excel Facts

Create a Pivot Table on a Map
If your data has zip codes, postal codes, or city names, select the data and use Insert, 3D Map. (Found to right of chart icons).
You may have to turn off automatic calculation for the sheets you need to control and then manually update them as needed. To turn off sheet calcs:
Developer - Properties - EnableCalculation=False

Then you can use VBA to manually calculate
VBA Code:
Dim WS As Worksheet
  
  Set WS = Sheets("Setup")
  
  WS.EnableCalculation = True
  WS.Calculate
  WS.EnableCalculation = False
 
Upvote 0
You may have to turn off automatic calculation for the sheets you need to control and then manually update them as needed. To turn off sheet calcs:
Developer - Properties - EnableCalculation=False

Then you can use VBA to manually calculate
VBA Code:
Dim WS As Worksheet
 
  Set WS = Sheets("Setup")
 
  WS.EnableCalculation = True
  WS.Calculate
  WS.EnableCalculation = False
OK I'll give it a try, where should I put that code? in what module?
 
Upvote 0
If you create a macro button to do this then it would be in the SHEET level. Otherwise if you add the code to a standard module, you'll have to run it manually or add a keystroke command to the macro.
 
Upvote 0

Forum statistics

Threads
1,214,968
Messages
6,122,509
Members
449,089
Latest member
RandomExceller01

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
Back
Top