Hi everyone!

In my program, I have code that I'm looking to run more efficiently.

It looks like this:

This was fine before. However, I now want to make a version with 72 members in the array and end up with something that looks like this:Code:Private Sub generate_random_sequence_12() Randomize random_number_array(1) = 0 random_number_array(2) = 0 random_number_array(3) = 0 random_number_array(4) = 0 random_number_array(5) = 0 random_number_array(6) = 0 random_number_array(7) = 0 random_number_array(8) = 0 random_number_array(9) = 0 random_number_array(10) = 0 random_number_array(11) = 0 random_number_array(12) = 0 Dim count For count = 1 To 12 Do random_number = Int(12 * Rnd) + 1 Loop While random_number = random_number_array(1) _ Or random_number = random_number_array(2) Or random_number = random_number_array(3) _ Or random_number = random_number_array(4) Or random_number = random_number_array(5) _ Or random_number = random_number_array(6) Or random_number = random_number_array(7) _ Or random_number = random_number_array(8) Or random_number = random_number_array(9) _ Or random_number = random_number_array(10) Or random_number = random_number_array(11) _ Or random_number = random_number_array(12) random_number_array(count) = random_number Next count End Sub

Is there a way of cutting this down to two or three lines?Code:random_number_array(1) = 0 random_number_array(2) = 0 random_number_array(3) = 0 random_number_array(4) = 0 random_number_array(5) = 0 random_number_array(6) = 0 random_number_array(7) = 0 random_number_array(8) = 0 random_number_array(9) = 0 random_number_array(10) = 0 random_number_array(11) = 0 random_number_array(12) = 0 random_number_array(13) = 0 random_number_array(14) = 0 random_number_array(15) = 0 random_number_array(16) = 0 random_number_array(17) = 0 random_number_array(18) = 0 random_number_array(19) = 0 random_number_array(20) = 0 random_number_array(21) = 0 random_number_array(23) = 0 random_number_array(24) = 0 random_number_array(25) = 0 random_number_array(26) = 0 random_number_array(27) = 0 random_number_array(28) = 0 random_number_array(29) = 0 random_number_array(30) = 0 random_number_array(31) = 0 random_number_array(32) = 0 random_number_array(33) = 0 random_number_array(34) = 0 random_number_array(35) = 0 random_number_array(36) = 0 random_number_array(37) = 0 random_number_array(38) = 0 random_number_array(39) = 0 random_number_array(40) = 0 random_number_array(41) = 0 random_number_array(42) = 0 random_number_array(43) = 0 random_number_array(44) = 0 random_number_array(45) = 0 random_number_array(46) = 0 random_number_array(47) = 0 random_number_array(48) = 0 random_number_array(49) = 0 random_number_array(50) = 0 random_number_array(51) = 0 random_number_array(52) = 0 random_number_array(53) = 0 random_number_array(54) = 0 random_number_array(55) = 0 random_number_array(56) = 0 random_number_array(57) = 0 random_number_array(58) = 0 random_number_array(59) = 0 random_number_array(60) = 0 random_number_array(61) = 0 random_number_array(62) = 0 random_number_array(63) = 0 random_number_array(64) = 0 random_number_array(65) = 0 random_number_array(66) = 0 random_number_array(67) = 0 random_number_array(68) = 0 random_number_array(69) = 0 random_number_array(70) = 0 random_number_array(71) = 0 random_number_array(72) = 0

Any help would be much appreciated!