Hi,
I am trying to do a calculation by dividing the value in cell "H" with (1+"I") and adding to cell "T". However calculation stops and returns blank cell when there is a blank value in cell H or I.
For Ex: If i want to do calculation for 12,000 rows and cell H1234 has a blank value it only does the calculation thru T1234 and returns blank for rest of the range. Did anyone come across similar issue and has solution for it? Thanks
I am trying to do a calculation by dividing the value in cell "H" with (1+"I") and adding to cell "T". However calculation stops and returns blank cell when there is a blank value in cell H or I.
For Ex: If i want to do calculation for 12,000 rows and cell H1234 has a blank value it only does the calculation thru T1234 and returns blank for rest of the range. Did anyone come across similar issue and has solution for it? Thanks
Code:
Sub lybase()
Dim xlCalc As XlCalculation
On Error GoTo ErrorHandler
xlCalc = Application.Calculation
Application.Calculation = xlCalculationManual
Dim lRow As Long
lRow = Sheets("Source Data").Range("a" & Rows.Count).End(xlUp).Row
For i = 2 To lRow
Cells(i, 20) = Cells(i, 8) / (1 + Cells(i, 9))
Next i
ErrorExit:
On Error Resume Next
Application.Calculation = xlCalc
Exit Sub
ErrorHandler:
Debug.Print Err.Number & vbLf & Err.Description
Resume ErrorExit
End Sub