Ver Mensaje Individual
  #1 (permalink)  
Antiguo 25/11/2008, 08:50
RosaElena22
 
Fecha de Ingreso: noviembre-2008
Mensajes: 6
Antigüedad: 15 años, 6 meses
Puntos: 0
Ayuda,ncesito contar valores de un arreglo pero...

Hola este es mi codigo:
Dim i As Int32
Dim Y(9), x1(9), A, SUMYX1 As Double
Y(1) = (D1.Text)
Y(2) = (D2.Text)
Y(3) = (D3.Text)
Y(4) = (D4.Text)
Y(5) = (D5.Text)
Y(6) = (D6.Text)
Y(7) = (D7.Text)
Y(8) = (D8.Text)
Y(9) = (D9.Text)



x1(1) = (P1.Text)
x1(2) = (P2.Text)
x1(3) = (P3.Text)
x1(4) = (P4.Text)
x1(5) = (P5.Text)
x1(6) = (P6.Text)
x1(7) = (P7.Text)
x1(8) = (P8.Text)
x1(9) = (P9.Text)
For i = A To 9
SUMYX1 = SUMYX1 + Y(i) * x1(i)

Me.F1.Text = Y(1) * x1(1)
Me.F2.Text = Y(2) * x1(2)
Me.F3.Text = Y(3) * x1(3)
Me.F4.Text = Y(4) * x1(4)
Me.F5F.Text = Y(5) * x1(5)
Me.F6.Text = Y(6) * x1(6)
Me.F7.Text = Y(7) * x1(7)
Me.F8.Text = Y(8) * x1(8)
Me.F9.Text = Y(9) * x1(9)

Next
'ORDENARLOS DESCENDENTE
Dim X As Integer
Dim Vector(9) As Double
Dim Auxiliar As Double

Dim Modifico As Boolean


'Next X
Vector(1) = Me.F1.Text
Vector(2) = Me.F2.Text
Vector(3) = Me.F3.Text
Vector(4) = Me.F4.Text
Vector(5) = Me.F5F.Text
Vector(6) = Me.F6.Text
Vector(7) = Me.F7.Text
Vector(8) = Me.F8.Text
Vector(9) = Me.F9.Text

Modifico = True
Do While Modifico = True
Modifico = False
For X = 1 To 8
If Vector(X + 1) > Vector(X) Then
Auxiliar = Vector(X)
Vector(X) = Vector(X + 1)
Vector(X + 1) = Auxiliar
Modifico = True
End If
Next X
Loop



For X = 1 To 9

Me.B1.Text = Vector(1)
Me.B2.Text = Vector(2)
Me.B3.Text = Vector(3)
Me.B4.Text = Vector(4)
Me.B5.Text = Vector(5)
Me.B6.Text = Vector(6)
Me.B7.Text = Vector(7)
Me.B8.Text = Vector(8)
Me.B9.Text = Vector(9)



Next
Dim SUMY, IX, J As Integer
'For I = 1 To 3
' SUMXX1 = SUMXX1 + Vector(X)
'Next
'Me.TextBox5.Text = SUMXX1
For IX = 1 To 9
SUMY = SUMY + Vector(IX)
Next IX
Me.TextBox28.Text = SUMY
For J = 1 To 9
Me.T1.Text = Math.Round(Val(Vector(1) * 100) / SUMY, 2)
Me.T2.Text = Math.Round(Val(Vector(2) * 100) / SUMY, 2)
Me.T3.Text = Math.Round(Val(Vector(3) * 100) / SUMY, 2)
Me.T4.Text = Math.Round(Val(Vector(4) * 100) / SUMY, 2)
Me.T5.Text = Math.Round(Val(Vector(5) * 100) / SUMY, 2)
Me.T6.Text = Math.Round(Val(Vector(6) * 100) / SUMY, 2)
Me.T7.Text = Math.Round(Val(Vector(7) * 100) / SUMY, 2)
Me.T8.Text = Math.Round(Val(Vector(8) * 100) / SUMY, 2)
Me.T9.Text = Math.Round(Val(Vector(9) * 100) / SUMY, 2)


Next


'PROCENTAJE ACUMULADO

Me.AC1.Text = Me.T1.Text
Me.AC2.Text = Val(Me.T1.Text) + Val(Me.T2.Text)
Me.AC3.Text = Val(AC2.Text) + Val(T3.Text)
Me.AC4.Text = Val(AC3.Text) + Val(T4.Text)
Me.AC5.Text = Val(AC4.Text) + Val(T5.Text)
Me.AC6.Text = Val(AC5.Text) + Val(T6.Text)
Me.AC7.Text = Val(AC6.Text) + Val(T7.Text)
Me.AC8.Text = Val(AC7.Text) + Val(T8.Text)
Me.AC9.Text = Math.Round(Val(AC8.Text) + Val(T9.Text), 0)

r1.Text = Math.Round(Val(Me.T1.Text) + Val(Me.T2.Text) + Val(Me.T3.Text) + _
Val(Me.T4.Text) + Val(Me.T5.Text) + Val(Me.T6.Text) + Val(Me.T7.Text) + Val(Me.T8.Text) + Val(Me.T9.Text), 0)

r2.Text = Val(Me.AC1.Text) + Val(Me.AC2.Text) + Val(Me.AC3.Text) + Val(Me.AC4.Text) + Val(Me.AC5.Text) + Val(Me.AC6.Text) + Val(Me.AC7.Text) + Val(Me.AC8.Text) + Val(Me.AC9.Text)

'Dim K As Integer
'For K = 1 To 9
' SUMP = SUMP + x1(i)
'Next i
'Me.r2.Text = SUMX1
'Me.r1.Text = SUMP
************************************************** ********
SI algo extenso,emjorcon una imagen
http://img46.imageshack.us/my.php?image=mirendx2.jpg

ahora loq necesito es:
http://img46.imageshack.us/my.php?image=mire02faltagj1.jpg
debo contaro todos lso arituclos q esten antes de 75%,y tmb contar los etsn comrpendidos de 75-95,y luego los estan mas de 95,en las nuievas cajas detetxo dela 2 imagen,pero :s no recuerdo como hacerlo,alguna ayuda.