K
ker_01
I have a 2D variant array that is populated with a large worksheet range
(large enough to ensure that I won't miss any data from some variable length
reports).
The actual number of 'used' rows in the array may change over time as well,
as there are pieces of code that may add or remove records (rows).
Right now, I'm looping the entire array every time I need to compare data,
which is inefficient because sometimes only a fraction of the array is
actually populated with data. I do recursive looping, so it adds a lot of
processing time.
Is there a parameter I can check that would tell me the last 'used' row of
an array? UBound gives the size of the array regardless of whether it is
populated, so probably isn't the right direction for me to go.
One option would be to loop the array to find the last used row directly,
but I'm not sure that would save me much time over just looping the array to
compare data in the first place.
Many thanks,
Keith
(large enough to ensure that I won't miss any data from some variable length
reports).
The actual number of 'used' rows in the array may change over time as well,
as there are pieces of code that may add or remove records (rows).
Right now, I'm looping the entire array every time I need to compare data,
which is inefficient because sometimes only a fraction of the array is
actually populated with data. I do recursive looping, so it adds a lot of
processing time.
Is there a parameter I can check that would tell me the last 'used' row of
an array? UBound gives the size of the array regardless of whether it is
populated, so probably isn't the right direction for me to go.
One option would be to loop the array to find the last used row directly,
but I'm not sure that would save me much time over just looping the array to
compare data in the first place.
Many thanks,
Keith