给你一个模型吧
'新建text1-text2-text3-text4
Private Sub Form_Load()
Randomize
Show
P1 = 0
P2 = 0 + 20
P3 = 0 + 20 + 0
P4 = 0 + 20 + 0 + 80
For I = 1 To 1000
DoEvents
A = Int(Rnd * 100 + 1)
Select Case A
Case 1 To P1
Text1.Text = Val(Text1.Text) + 1
Case P1 + 1 To P2
Text2.Text = Val(Text2.Text) + 1
Case P2 + 1 To P3
Text3.Text = Val(Text3.Text) + 1
Case P3 + 1 To P4
Text4.Text = Val(Text4.Text) + 1
End Select
Next I
End Su