Hi,
Can someone help me optimiz and speed up the run time for below code? It's taking long to calculate subtract, divide and %?
Thanks
Can someone help me optimiz and speed up the run time for below code? It's taking long to calculate subtract, divide and %?
Code:
Sub MathL4WMANUFACTURER()
Dim i As Integer
Dim condition As Range
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
With Sheets("HDD")
For i = 16 To 26
.Cells(i, 16) = .Cells(i, 14) - .Cells(i, 15)
If .Cells(i, 15) <> 0 Then
.Cells(i, 17) = .Cells(i, 14) / .Cells(i, 15) - 1
End If
If .Range("N16") <> 0 Then
.Cells(i, 18) = .Cells(i, 14) / .Range("N16") * 100
End If
If .Range("O16") <> 0 Then
.Cells(i, 19) = .Cells(i, 15) / .Range("O16") * 100
End If
.Cells(i, 20) = .Cells(i, 18) - .Cells(i, 19)
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
Next i
End With
End Sub
Thanks