I need to do something like this that works in VBA for Excel:
That doesn't work in VBA.
What I want is to take a large, one dimensional array of numbers and make a new array that contains the 10 numbers that are right before the last 5 numbers in the array.
Here's an example:
LargeArray(1,2,3,4,5,6,7,8,9,,,,,,,100,101,102,103,104,105,106,107,108,109,110)
Extracting from it this new array:
NewArray(101,102,103,104,105)
Code:
HowMany As Single
FromEnd As Single
LargeArray As Variant
NewArray As Variant
HowMany = 10
FromEnd = 5
LargeArray =(1,2,3,,,10000)
NewArray = LargeArray.split(HowMany, FromEnd)
What I want is to take a large, one dimensional array of numbers and make a new array that contains the 10 numbers that are right before the last 5 numbers in the array.
Here's an example:
LargeArray(1,2,3,4,5,6,7,8,9,,,,,,,100,101,102,103,104,105,106,107,108,109,110)
Extracting from it this new array:
NewArray(101,102,103,104,105)