I am having a problem with getting 100% 'Unique' results in the randomization of a roster of groups.
Is it possible to modify this code that randomizes all the rosters on the spreadsheet so that when a 'Unique' value is obtained, it is left alone?
Right now the desired percentage is at 92% because when I have increased the percentage, the randomization takes too long to generate, or never generates, the desired result.
Sub refresher()
For Count = 1 To 500
Calculate
UniCount = Application.CountIf(Range("A:F"), "Unique")
DupCount = Application.CountIf(Range("A:F"), "Duplicate")
Percent = UniCount / (UniCount + DupCount)
If UniCount / (UniCount + DupCount) > 0.92 Then Exit For
Next
End Sub
Would it be another IF
statement I have to add? Something like, IF value of pair is 'Unique', leave alone, and randomize the rest until they're 'Unique'. I want to make it so that I can randomize for 100% 'Unique' results more effectively.
Is it possible to attach a sample of the spreadsheet?