Hi. I am trying to create a function in VBA that will take any array (so could have any number of dimensions), and shift it to base 0.

For instance, I want the function to be able to be able to take the following

Code:
dim outputArray() as variant
outputArray = myRebaseFunction(inputArray)
so inputArray(1 to 5, 3 to 6) would produce outputArray(0 to 4, 0 to 3), containing all the data of inputArray. Similarly, inputArray (2 to 4, 0 to 1, 3 to 7) would produce outputArray (0 to 2, 0 to 1, 0 to 4), containing all the data of inputArray. If the inputArray always had the same number of dimensions, it would be easy, but given the number of dimensions can be different for different inputArrays, does anyone know a way of dealing with this?

Thanks