Saladsamurai
12-05-2009, 12:33 PM
Alrighty then :) I am trying to get all of this 'passing values' stuff sorted out and I feel like I am doing well. But I have hit a few snags that I need help with:
I have a module I am writing. One of the Subs called Sub GetAugMatrix(mSize as Integer) picks up values for an Array called 'AugMatrix' from the the Worksheet based on the size of the Worksheet Matrix..
So now I have this Array 'AugMatrix.'
The problem is that now I want to write another Sub that does some stuff to AugMatrix. This Sub will be called RREF() and it should take in an Array as its argument and return an array as well.
So I need a way of getting the Array 'AugMatrix' from Sub GetAugMatrix() into RREF().
I have a feeling that this will involve turning my 'Subs' into 'Functions' instead.
How can I change the Sub GetAugMatrix(mSize as Double) into a function so that it actually returns an Array instead of just making one?
I want the general flow of the program to be something to the effect of:
After the Command Button is clicked-->AugMatrix= GetAugMatrix(mSize)--->FinalArray = RREF(AugMatrix)
SO I guess my main question is what is the syntax to tell excel that this function should take in an array whose elements are of type double and should return an array of type double.
Here is the WrBk. Any ideas are welcome!
I have a module I am writing. One of the Subs called Sub GetAugMatrix(mSize as Integer) picks up values for an Array called 'AugMatrix' from the the Worksheet based on the size of the Worksheet Matrix..
So now I have this Array 'AugMatrix.'
The problem is that now I want to write another Sub that does some stuff to AugMatrix. This Sub will be called RREF() and it should take in an Array as its argument and return an array as well.
So I need a way of getting the Array 'AugMatrix' from Sub GetAugMatrix() into RREF().
I have a feeling that this will involve turning my 'Subs' into 'Functions' instead.
How can I change the Sub GetAugMatrix(mSize as Double) into a function so that it actually returns an Array instead of just making one?
I want the general flow of the program to be something to the effect of:
After the Command Button is clicked-->AugMatrix= GetAugMatrix(mSize)--->FinalArray = RREF(AugMatrix)
SO I guess my main question is what is the syntax to tell excel that this function should take in an array whose elements are of type double and should return an array of type double.
Here is the WrBk. Any ideas are welcome!