Hi,
I would like to total a list box full of numbers and put this total in a text box. I have tried this code, but when I run it I get a “type mismatch” error.
For i = 1 To List4.ListCount
x = x + CInt(List4.List(i))
Next
txtTotals(0).Text = x
when I take the CInt off, it adds up the numbers but puts them in a string format: 3502550, instead of adding 350+25+50
Thanks very much for any help!!!
I would like to total a list box full of numbers and put this total in a text box. I have tried this code, but when I run it I get a “type mismatch” error.
For i = 1 To List4.ListCount
x = x + CInt(List4.List(i))
Next
txtTotals(0).Text = x
when I take the CInt off, it adds up the numbers but puts them in a string format: 3502550, instead of adding 350+25+50
Thanks very much for any help!!!