Good morning,
Since I'm bad at VBA, I need your help.
In cell S8 there is a numerical value which represents the number of columns authorized (manually editable value)
In cell S9 there is a numerical value which represents the maximum number to distribute (manually editable value)
In cell S10 there is a numerical value which represents the number of lines authorized (manually editable value)
I want to randomly distribute (with a VBA button) the numbers from 01 up to the number in cell S9 in the range D9:M100 according to the following conditions:
1- Random distribution in the range D9:M100 from 01 to cell number S9 in empty cells only and not repeating the same number in the same row, and replace the repeated number with another number
2- The number of columns in which the distribution is authorized is equal to the number in cell S8
3- The number of lines in which distribution is authorized is equal to the number in cell S10
4- The number of columns entered in cell S8 does not exceed the number entered in S9, if otherwise an error message is displayed
4 - The distribution is carried out only in the empty cells of the range D9:M100
5 - Allow the number to be repeated only once in each column
6 - compensation of cells containing letters with cells containing numbers at the end of the column (according to the conditions mentioned previously, with the exception of the condition of the number of lines).
Attached the file
Thank you.
Bookmarks