I have problem: Slow - VBA Copy Paste recalculate

thd610

New Member
Joined
Jun 18, 2019
Messages
1
I was testing for bottlenecks in some project finance code to test for IRR and the bottle next appears to be on bit where the range is moved before a recalculation occurs to see how far away the answer is from being solved.

Code:
Call MoveDate(Names("CopyRange").RefersToRange, Names("PasteRange").RefersToRange)


Code:
Sub MoveDate(rngCopy As Range, rngPaste As Range)


rngPaste.Value2 = rngCopy.Value2 ' Takes around 1.2 - 1.5 seconds to run
Application.calculate ' Takes around 1.5 - 1.8 seconds to run


End Sub

The above is part of a wider macro that takes ~200 seconds to solve and this part accounts for ~75% of the time with it being called lots of times. each line taking over a second to complete.

Can anyone think of any better ways of completing this task in a more efficient way?
The data table is 3096 cells, 36 * 86
Calculate mode is set to manual, screen updates and enable events are set to False.

Thanks for reading
 

Some videos you may like

Excel Facts

What is the last column in Excel?
Excel columns run from A to Z, AA to AZ, AAA to XFD. The last column is XFD.

Watch MrExcel Video

Forum statistics

Threads
1,099,567
Messages
5,469,452
Members
406,652
Latest member
LJA

This Week's Hot Topics

Top