0

hey guys

quick one, im doing an income vs expenses form on VB, i have two mulitline textboxes, one for income and one for expenses. Everything works well but i dont know how to add up the numbers in the textboxes when i have say 5 incomes, in the income box, each on a new line and 3 expeneses, each on a new line on the expeneses textbox. i am using a button to do the calculation and output of profit/loss is in a message box. PLease assit

2
Contributors
3
Replies
13
Views
2 Years
Discussion Span
Last Post by MatthewVb
0

How about

Dim total As Single = 0.0

For Each line As String In TextBox1.Lines
    If IsNumeric(line) Then
        total += CSng(line)
    End If
Next
0

thank you i shall try this and let you know... will also post my code once ive added your lines

0

great thank you so much it works perfectly, your help is much appreciated

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.