How do I make this code shorter? to maximum value TxtConsecutiveNumber2.Lines(i)=("79,80") Thanks. I want to make this code short,, TxtConsecutiveCount will always be + 1'd value. TxtConsecutiveCount1.Text, TxtConsecutiveCount2.Text,TxtConsecutiveCount3.Txt and TxtConsecutiveNumber2.Lines(i) remains the same, but will be equal as follows.
For i As Integer = 1 To Val(TxtConsecutiveNumber2Count.Text)
If TxtConsecutiveNumber2.Lines(i) = ("1,2") Then
TxtConsecutiveCount1.Text = Val(TxtConsecutiveCount1.Text) + Val(1)
Else
End If
If TxtConsecutiveNumber2.Lines(i) = ("2,3") Then
TxtConsecutiveCount2.Text = Val(TxtConsecutiveCount2.Text) + Val(1)
Else
End If
If TxtConsecutiveNumber2.Lines(i) = ("3,4") Then
TxtConsecutiveCount3.Text = Val(TxtConsecutiveCount3.Text) + Val(1)
Else
End If
If TxtConsecutiveNumber2.Lines(i) = ("4,5") Then
TxtConsecutiveCount4.Text = Val(TxtConsecutiveCount4.Text) + Val(1)
Else
End If
If TxtConsecutiveNumber2.Lines(i) = ("5,6") Then
TxtConsecutiveCount5.Text = Val(TxtConsecutiveCount5.Text) + Val(1)
Else
End If
This code should go up to.
If TxtConsecutiveNumber2.Lines(i) = ("79,80") Then
TxtConsecutiveCount79.Text = Val(TxtConsecutiveCount5.Text) + Val(1)
Else
End If
How?
Sorry, but your question is still unclear, but i think i know what you want to achieve.