不一定非得要这样计算啊,可以变通一下啊!比如,单击某个单据号后系统记忆此结果,在单击下一个时加上上一个记忆的数字变成一个新的数字,以此类推,就得到了最终的记过了啊!
Private Sub Command1_Click()
Dim i As Integer, x As Long
For i = 0 To List1.ListCount - 1
If List1.Selected(i) Then
x = x + Val(List1.List(i))
End If
Next
MsgBox x
End Sub
Private Sub Form_Load()
Dim i As Integer
For i = 100 To 150
List1.AddItem i
Next
End Sub
能详细描述一下吗?
vb*listbox