Originally Posted by
Evil_Genious
I'm not really a Excel programmer LOL.
But my penis tells me you need something called a "conditional" here.
i.e. you need to create a formula in a cell. So you say that randbetween() is a function which 'generates a random number between', assuming this is the case do something like the following. What the syntax is - is perhaps irrelevent.
Say you have a matrix A1 to E1 horizontal and A1 to A5.
If you want to generate a random number in A1 you would write randbetween();
So now you have a number to start with.
in A2 you want to a 'Do While' loop or something similar - if you are using VB, there must be a phenomenon as such.
would be something like:
Do randbetween() while (A2 == A1);
This will execute randbetween once and then evaluate the conditional statement, and if A2 'is equal to' A1 then another randbetween is done, until the condition evaluates to False. i.e. when the value is unique.
Subsequent formulas will be similar but with different cells:
A3:
Do randbetween() while (A3 == A1 || A3 == A2 || A3 == n);
etc......
With syntax, I can't help you.
Bookmarks