DefSng A-Z
Dim a(10) As String, b(10), c(10), d(10), e(10), f(10), pc, tot
Private Sub Command1_Click()
pc = pc + 1
a(pc) = Text1.Text
b(pc) = Text2.Text
tot = tot + b(pc)
Text1.Text = ""
Text2.Text = ""
Text1.SetFocus
End Sub
Private Sub Command2_Click()
For i = 1 To pc
c(i) = b(i) * 1000
d(i) = Int(1000 * 20 * (b(i) / tot) + 0.5)
e(i) = Int(c(i) + d(i) * 0.1 + 0.5)
f(i) = c(i) + d(i) + e(i)
h2 = h2 + c(i)
h3 = h3 + d(i)
h4 = h4 + e(i)
h5 = h5 + f(i)
Next