I have a sheet with a data range that's about 50,000x100. I load that into an array for testing and one of the tests is to see if a set of cells are all zero. Right now I'm doing this by looping through each array element (roughly from array(c,20) to array(c,100)) to see if the sum is zero. Depending on the answer the sub branches off.
This is currently the slowest part of the routine by far.
Can anyone suggest a faster way to determine if a set of elements in an array are all zero rather than looping.
Code:
ACCTG_ENTRY_TOTAL = 0
For c = 20 To COLUMN_OF_INTEREST_NUMBER - 1 'Column #20 is the first with Financial data
ACCTG_ENTRY_TOTAL = ACCTG_ENTRY_TOTAL + DATA_ARRAY1(a, c)
Next c
This is currently the slowest part of the routine by far.
Can anyone suggest a faster way to determine if a set of elements in an array are all zero rather than looping.