In my VBA program, I have a big array of data, where I need to constantly use its sub-arrays.
My method is:
Redim subArr(rowBegin to rowEnd)
For r = rowBegin to rowEnd
subArr(r) = bigArr(r)
Next r
Is there any more efficient way to reference this kind of sub-arrays please? Thanks…
Working with arrays is incredibly fast so this will probably give no discernable benefit – althouh I can understand how it may appeal from a coding sense than looping to fill a smaller array
Given you are working with a single element array you could:
Jointhe large array with a delimiter into a single stringSplitthe large array by the “marker” string, then separate the reduced string into a smaller array with the delimiterThe code below dumps the numbers 1 to 100 into an array, and then splits it as above to pull out the first 10 records