How does EXCEL choose the number for Fucai two-color ball machine?

Click the button to use VBA programming, use a current table to display buttons and button results, and add a background table to save the selected results to control repetition. The processing logic of the button is as follows:

0 start = "1Generate a set of data = =" 2 Data sorting = = "3 Judge whether the data conforms to the rules; If not, return to 1 =" 4 to judge whether the data is in the database; If yes, return 1 = = "5 to output the generated results to this table = =" 6 to save the results in the library.

There are ***6 steps in total, and the slightly more difficult step is 1, 3, 4. Please copy the screen and ask questions when you encounter problems in programming.