I have four arrays that will have up to ten values in each. Some of the values will be zero or nothing so that the table may look like
(i) txtL(i) txtQ(i) txtO(i) S35Q(i)
0 500 20 2 18
1 350 10 0 10
2 600 30 5 25
3
4 400 15 0 15
5 600 8 0 8
6
7
8
9
I have this code
That will give me S35Q(i). Next I have to sort the data so that I end up with
i txtL(i) S35Q(i)
0 500 18
1 350 10
2 600 25
4 400 15
5 600 8
And then to total S35Q where values of txtL are the same. In this example the value of txtL for i = 2 and i = 4 are both 600 so S35Q(2) becomes 33 and S35Q(5) drops off. Also i = 4 becomes i = 3. I now have an array with upper limit of 3. Then I have to count to obtain a new value for the array size (j).
i txtL(i) S35Q(i)
0 500 18
1 350 10
2 600 33
3 400 15
Would someone please get me started on the method to achieve this.
Thanks
(i) txtL(i) txtQ(i) txtO(i) S35Q(i)
0 500 20 2 18
1 350 10 0 10
2 600 30 5 25
3
4 400 15 0 15
5 600 8 0 8
6
7
8
9
I have this code
Code:
For i = 0 To 9
If Len(txt35L(i).Text) > 0 And Len(txt35O(i).Text) > 0 Then
S35Q(i) = txt35Q(i).Text - txt35O(i).Text
ElseIf Len(txt35L(i).Text) > 0 And Len(txt35O(i).Text) = 0 Then
S35Q(i) = txt35Q(i).Text
Else
S35Q(i) = 0
End If
Next
i txtL(i) S35Q(i)
0 500 18
1 350 10
2 600 25
4 400 15
5 600 8
And then to total S35Q where values of txtL are the same. In this example the value of txtL for i = 2 and i = 4 are both 600 so S35Q(2) becomes 33 and S35Q(5) drops off. Also i = 4 becomes i = 3. I now have an array with upper limit of 3. Then I have to count to obtain a new value for the array size (j).
i txtL(i) S35Q(i)
0 500 18
1 350 10
2 600 33
3 400 15
Would someone please get me started on the method to achieve this.
Thanks