|
see if my understand is correct
Sub 计算()
Dim at, arr, i
at = Sheets("ALL").Range("A4:Z6500")
ReDim arr(1 To UBound(at), 1 To 24)
For i = 4 To UBound(arr)
If Application.WorksheetFunction.IsNumber(Cells(i, 20)) = False Then '订货周期计算
Cells(i, 14).Value = Cells(i, 20)
Else
If Application.WorksheetFunction.IsNumber(Cells(i, 7)) = False Then
Cells(i, 14).Value = Cells(i, 7)
Else
Cells(i, 14).Value = Cells(i, 20) - Cells(i, 7)
If Cells(i, 14).Value > 10000 Then
Cells(i, 14).Value = Cells(i, 13)
End If
End If
End If
If IsNumeric(Cells(i, 14)) = False Or Cells(i, 10) = 0 Or Cells(i, 14) = 0 Then '日均消耗计算
Cells(i, 11).Value = Cells(i, 14)
Else
Cells(i, 11).Value = Cells(i, 10) / Cells(i, 14)
End If
If Application.WorksheetFunction.IsNumber(Cells(i, 11)) = False Or Cells(i, 11) = 0 Then '完全消耗周期计算
Cells(i, 12).Value = Cells(i, 11)
Else
Cells(i, 12).Value = Cells(i, 24) / Cells(i, 11)
End If |
|