Private Sub CommandButton2_Click()
Dim Mini As Byte, Maxi As Long, i As Long
For i = 0 To ListBox1.ListCount - 1
ListBox1.Selected(i) = 0
Next i
Do Until TextBox1 >= CDbl(TextBox2.Value / 10)
Mini = 0
Maxi = ListBox1.ListCount - 1
Randomize
ListBox1.Selected(Int((Maxi - Mini + 1) * Rnd + Mini)) = True
Loop
If CDbl(TextBox2) / CDbl(TextBox1) < 9.5 Then CommandButton2_Click
End Sub