In the code below
For i = LBound(arr) To UBound(arr)
What is the point in asking using LBound
? Surely that is always 0.
Why not use For Each
? That way you don't need to care what the LBound
and UBound
are.
Dim x, y, z
x = Array(1, 2, 3)
For Each y In x
z = DoSomethingWith(y)
Next