How to speed up CPU calculation in looping?

alee001

Board Regular
Joined
Sep 9, 2014
Messages
154
Office Version
  1. 2010
Platform
  1. Windows
Anyone comment with following code so that speed up CPU calculation in looping?
Code:
Application.Calculation = xlCalculationAutomatic

Do while
...
    Do  
       Application.Calculation = xlCalculationMaunal
       mid = (high + low) / 2  'bi-section
       Range("f" & r1) = mid  'input tick
       rows(r1-1 &":"& r1).Calculate  'rows calculation
       scan_M = Range("be" & r1)  'output signal
       If scan_M <> scan_H Then
           low = mid
       ElseIf scan_M <> scan_L Then
           high = mid
       End If
    Loop While high - low > delta
    Application.Calculation = xlCalculationAutomatic
...
loop
 

Excel Facts

How to total the visible cells?
From the first blank cell below a filtered data set, press Alt+=. Instead of SUM, you will get SUBTOTAL(9,)
Hi,

We don't know what data the code is processing but there's one glaring issue in that disabling and re-enabling calculation should be outside of the DO loop. The way it is now it gets turned off and on continuously.
 
Upvote 0
Because of calculation all sheet will be increase CPU work load on looping during input tick and output signal, so I set rows calculation partly in looping so that speed up CPU but there seems to be no effect.
 
Upvote 0

Forum statistics

Threads
1,223,214
Messages
6,170,772
Members
452,353
Latest member
strainu

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