I've been trying to understand for already some time. And may be - I got it (or may be not
)
In columns FGHI expected result is that there shall be numbers from A1:B2, A3:B4, A5:B6 and A7:B8 in a way that one of them is from each corner of An:Bn+1 square.
So with jorels nomenclature we shall randomly select numbers from each of 4 squares, but observing the rule that every one of them shall be from different position ABCD, ABDC, ACBD, ACDB etc.
and the same for next for squares A9:B16, etc.
As these data go down to B48 we will end up with 24 numbers in cells Fx:ACx.
(still wondering where is
we have 45 groups, you have to generate 40 numbers
mentioned in post #5)
The following code generates 1000 of such sets.
Sub test()
Const strABCD = "1,1;1,2;2,1;2,2"
Const strCOMB = "0123;0132;0213;0231;0312;0321;1023;1032;1203;1230;1302;1320;2013;2031;2103;2130;2301;2310;3012;3021;3102;3120;3201;3210"
Dim i%, j%, k%, nr%, ABCD, COMB, myOFFSET
COMB = Split(strCOMB, ";")
ABCD = Split(strABCD, ";")
Randomize
Application.ScreenUpdating = False
For k = 4 To 1003
For i = 0 To 5
nr = WorksheetFunction.RandBetween(0, 23)
For j = 0 To 3
myOFFSET = Split(ABCD(CInt(Mid(COMB(nr), j + 1, 1))), ",")
Cells(k, i * 4 + j + 6) = Cells(i * 8 + j * 2 + CInt(myOFFSET(0)), CInt(myOFFSET(1)))
Next j
Next i
Next k
Application.ScreenUpdating = True
End Sub
Bookmarks