I have a huge range (80 K rows).
the values on that range are already sorted (from smallest to largest).
with the purpose to speed my code and also learning:
How to split that range into (4) even sequenced Arrays with condition that LBound / UBound
is not duplicated on the other Arrays?
Note:that range has a lot of duplicate values ( I cannot delete it ,to preserve consistency of the other data).
In advance, thanks for any helpful comments ,Ideas and answers.
Sub Split_Range_into_4_even_sequenced_Arrays()
Dim ws As Worksheet: Set ws = ActiveSheet
Dim LastRow As Long: LastRow = ws.Cells(ws.Rows.Count, 1).End(xlUp).Row
'Putting the whole range on one array,leads to the code takes a very long time to finish
Dim wholearr: wholearr = ws.Range("A1:A" & LastRow).Value2 '80K rows
'My Code
'The desired answer:Pseudocode
Dim arr1, arr2, arr3, arr4 'Split the whole range into (4) arrays to make the code faster
arr1 = ws.Range("A1:A" & UBound(arr1)).Value2 '1st quarter of the range
'My Code
arr2 = ws.Range("A" & LBound(arr2) & ":A" & UBound(arr2)).Value2 '2nd quarter of the range
'My Code
arr3 = ws.Range("A" & LBound(arr3) & ":A" & UBound(arr3)).Value2 '3rd quarter of the range
'My Code
arr4 = ws.Range("A" & LBound(arr4) & ":A" & UBound(arr4)).Value2 '4th quarter of the range
'My Code
End Sub