lunes, 19 de marzo de 2012

CICLOS 2!

*For a = 2 to 4
Cells (a, 5 ) = Cells (a, 2) * 30 / 100 + Cells (a, 3) * 30 /100 + cells (a, 4) * 40 / 100
Next

*For a = 2 to 5
if cells ( 1, 7 ) Then

*For a = 2 to 5
Cells (a, 6) = ""
Next


CICLOS!

para hallar la definitiva :

Private Sub CommandButton1_Click()
For a = 2 To 5
Cells(a, 5) = (Cells(a, 2) * 0.3) + (Cells(a, 3) * 0.3) + (Cells(a, 4) * 0.4)
Next
End Sub
para el promedio:

Private Sub CommandButton2_Click()
For i = 2 To 5
Cells(6, 5) = Cells(6, 5) + Cells(i, 5)
Next
Cells(6, 5) = Cells(6, 5) / 4
End Sub
para borrar lo anterior:

Private Sub CommandButton3_Click()
For a = 2 To 6
Cells(a, 5) = Clear
Next
End Sub