OldManExcellor
New Member
- Joined
- May 30, 2011
- Messages
- 45
I have a dynamic array that is somethimes empty. I want to do an operation on all array elements in my code. When there are no array elements, I want the code to just continue.
But the two methods to loop array elements that I know of aren't skipped when the dynamic array is empty. The generate errors.
I have been able to handle this using OnError Resume Next. But I'm thinking maybe there is some smoother way to avoid getting errors when the dynamic array is empty?
Your help is very appreciated.
But the two methods to loop array elements that I know of aren't skipped when the dynamic array is empty. The generate errors.
I have been able to handle this using OnError Resume Next. But I'm thinking maybe there is some smoother way to avoid getting errors when the dynamic array is empty?
Your help is very appreciated.
Code:
'Method 1
For i = 0 To arrayCount
Do stuff...
Next i
'Method 2
For Each currentElement In family
Do stuff...
Next