I have a table with 80 cells. 8 rows and 10 columns A1 to J8.
I want Excel to generate and enter 40 numbers (between 1 and 80).
Each number in its own space that means number 1 should appear in A1, number 2 in B1, number 11 in cell A2, number 80 in cell J8 and so on.
There numbers should be spread/allocated in the following way:
5 numbers in first row, 5 numbers in row 8, 3 numbers in column 1 and 3 numbers in column 10.
(Explanation: It is ok if Excel will input 5 numbers in row 1 and 8 and a sixth number will appear in this row because it was input in column 1 or 10 and it did end up in the first or eighth row because it was allocated in the corner).
There should be 16 numbers in the cells on the edge of the table.
Remaining 24 numbers should be allocated in cells B2:I7 in the following way:
Preferably 4 numbers in each row but not necessary.

Next step is for Excel to generate a new set of 40 numbers but 20 of them should be the same as in previous set.
I want to generate this way over 100 sets of 40 numbers in the following way if possible:
The numbers should be replaced evenly, for example in each row should be 2 or 3 new numbers generated and some left from the previous set.
I hope that I did not mess up my explanation.
I know that my request is not easy. If you need more explanations please let me know.

Another option I would like to add is for Excel to put all 40 generated numbers on 1 line underneath the table – all 100 sets in 100 rows in the order as they appear in the rows.

Thank you in advance for your help.
John