For - Next (Arrays)

You can iterate through the elements of an array using a For - Next loop


Run 5 Times

You can use a For - Next loop but you need to find out how many elements are in the array.

The UBOUND function can be used to return the number of items in a given dimension.


Multi Dimensional Array

This example will loop through both the dimensions.
The array is populated using the ARRAY function.
This uses part of the array and passes in 1 as the dimension.

This array is populated manually.
This uses the whole array and passes in 2 as the dimension.


© 2026 Better Solutions Limited. All Rights Reserved. © 2026 Better Solutions Limited TopPrevNext