To be able to redimension an array, you need to use a dynamic array.
To define a dynamic array use a Dim, Public, Private, or Static statement with empty parentheses. For example:
<pre> Private diagmatrix() as long</pre>
This way, you can redimension it as needed with a ReDim statement, for example:
<pre>ReDim diagmatrix(numofm, numofm) as long</pre>
As for your second point, I’m not sure to understand what you are asking for.
I just wanted to say thankyou very much for your help; much appreciated.