Hi there,
I'll try to be brief, In short im trying to add together a variable, (name = STRFinValue) within a For loop, I think the syntax should be:
STRTotal = STRFinValue +STRFinValue(f)
But I am very wrong.
Private Sub btnLBTotal_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnLBTotal.Click
Dim STR As String
Dim Position As Integer
Dim STRLength As String
Dim STRValue As Integer
Dim STRStart As Integer
Dim STRFinValue As Decimal
Dim STRToString As String
Dim STRTotal As Decimal
For f = 0 To (ListBox1.Items.Count - 1)
STR = ListBox1.Items.Item(f)
Position = InStr(1, STR, "£", 0)
Then
If Position > 0 Then
STRLength = STR.Length.ToString()
STRStart = (Convert.ToInt32(STRLength)) - ((Convert.ToInt32(STRLength)) - (Convert.ToInt32(Position)))
STRToString = STR.Substring(STRStart)
STRFinValue = (Convert.ToInt64(STRToString))
For counter As Integer = 0 To (ListBox1.Items.Count - 1)
STRTotal = STRFinValue + +(STRFinValue)
counter = counter + 1
Next
TextBox1.Text = Convert.ToString(STRTotal)
Else
MsgBox("Didn’t find £ sign.")
End If
Next
End Sub
Please do let me know if I have posted something in the wrong fashion & if I have not explained myself well.
Thanks for your time - is appreciated.