Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.programming
|
|||
|
|||
![]()
The "application.calculation=xlManual" did the trick!
There was even no need to deal with an array - the same 13K rows got processed in 11sec (as oppsed to 40 min), which is fine by me. I think I got an idea where the problem was. My input sheet with 13K rows has 3 columns with "cascading" formulae (the next row takes it's input from the previous one) which apparently got recalculated each time values got written to the output sheet. (I found it out by removing the "writing code" and running it with autoCalc enabled - the result was about as quick as the complete code with autoCalc disabled). The funny thing is that the cells I was writing to were NOT used as inputs by any formula. Why would Excel recalculate them? (It's more of a rhetorical question.) Many thanks again, Charles! J.Smith "Charles Williams" wrote in message ... Range transfer to/from VBA array would be great. This method is reasonably fast Sub klhjok() Dim vArr As Variant application.screenupdating=False application.calculation=xlManual ' ' get range into variant containing array ' vArr = Worksheets("fred").Range("A3:L50") ' ' show an element in the arry ' MsgBox vArr(10, 10) ' ' change element in array ' vArr(10, 10) = 123456 ' ' put array back to sheet ' in different place ' Worksheets("fred").Range("A3:L50").Offset(3, 20) = vArr application.screenupdating=true application.calculation=xlAutomatic End Sub regards Charles ______________________ Decision Models The Excel Calculation Site. www.DecisionModels.com |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Active Cell? = Iteration / Maximum Change Issue | Excel Discussion (Misc queries) | |||
Performance Issue | Excel Discussion (Misc queries) | |||
Excel2007 Conditional Formatting Slow Performance Issue | Excel Worksheet Functions | |||
Excel Performance issue | Excel Discussion (Misc queries) | |||
Excel Viewer performance issue | Excel Discussion (Misc queries) |