Hi,
Add 2 command buttons (command1, command2), 1 listbox (list1), 1 text box (text1) and 1 label (label1).
set the following captions for the command buttons
control caption
command1 add to listbox
command2 sum
Paste the following code :
Private Sub Command1_Click()
List1.AddItem Text1.Text
End Sub
Private Sub Command2_Click()
Dim l As Long
Dim lSum As Long
'MsgBox List1.ListCount
For l = 0 To List1.ListCount - 1
lSum = lSum + CLng(List1.List(l))
Next
Label1.Caption = lSum
End Sub
I hope this helps.
Cheers
Prakash.
Enter your message below
Sign in or Join us (it's free).