I'm working on a subroutine to perform some calculations and collect the results from several disparate tables (Of equal size and similar content) and then dump them into a worksheet. At the moment my driver looks like this:
Sub Driver()
Dim works() As Variant
Dim rng As Range
Dim ws as worksheet
'This reliably works and outputs an
works = GenerateWorksArray()
Set ws = Worksheets.Add
Set rng = ws.Range("A1:P1").Resize(UBound(works, 1))
'This is where it all breaks down
rng = works
end sub
The array passed back from GenerateWorksArray
is a 1,500 x 16 variant array that contains strings, currencies and doubles. For some reason, when i'm outputting the array with rng = works
, Only the first 156 rows are correctly outputted and from then on in I get nothing.
The code appears to be still running and if I click on a cell in that range I can see that the formula bar is wildly flickering. When I try and stop or break the code from executing excel just crashes. Has anyone experienced something similar and got a working solution together because I'm stumped?