Macro For i...Next i con if-else auxilio

Cordial saludo,

En la Hoja Formulario Tengo un a Tabla con Actividad, Unidad, Abscisas de Ref, Inicia, Termina, Longitud, Ancho, Espesor y Cantidad, debo completar esta información y busco automatizar algunas operaciones mediante este macro:

Sub CantidadNueva()
Dim F As Range
I = 14
Set F = Cells(I, 5)
F.Select
For I = 14 To 80
If F = "" Then Cells(I, 12).Value = ""
ElseIf F = "mes" Or F = "gal" Or F = "un" Or F = "trimestral" Or F = "gl" Then Cells(I, 12).Value = ""
ElseIf F = "ml" And Cells(I, 6) = "" Then Cells(I, 9).FormulaR1C1 = Abs(Cells(I, 8).Value - Cells(I, 7).Value) Cells(I, 12).Value = Abs(Cells(I, 8).Value - Cells(I, 7).Value)
ElseIf F = "ha" Or F = "m2" Then Cells(I, 9).FormulaR1C1 = Abs(Cells(I, 8).Value - Cells(I, 7).Value) Cells(I, 12).Value = Cells(I, 9).Value * Cells(I, 10).Value
Else Cells(I, 9).FormulaR1C1 = Abs(Cells(I, 8).Value - Cells(I, 7).Value) Cells(I, 12).Value = Cells(I, 9).Value * Cells(I, 10).Value * Cells(I, 11).Value
End If
I = I + 1
Next I
Cells(14, 12).Select
End Sub

Resultado que me funciona cuando la variable F es la misma, me puede ayudar. Gracias

La hoja de calculo se puede descargar de:

http://www.scribd.com/doc/106295275/Reporte-Diario-de-Actividades

Ayudenme por favor

Añade tu respuesta

Haz clic para o