Excel 2010 VBA
In order to make the code below run faster, I set the Application to manually calculate formulas. At the end of the code, I turn it back to automatic. However, in the status bar on the spreadsheet it still shows "Ready Calculate". When I hover over "Calculate" is says "Results of formulas may be out of date because Excel is not set to calculate automatically. Click here or press F9 to recalculate manually."
Also, Formulas --> Calculation --> Calculation Options is already set to Automatic.
I have tried executing Application.Calculation = xlCalculationAutomatic from the immediate window with no effect.
I cannot seem to turn the automatic calculation back on.
I saw in an earlier post a recommendation to review this cite: Excel Status Bar shows 'Calculate' - Decision Models. None of those conditions apply
Thanks in advance for any help
In order to make the code below run faster, I set the Application to manually calculate formulas. At the end of the code, I turn it back to automatic. However, in the status bar on the spreadsheet it still shows "Ready Calculate". When I hover over "Calculate" is says "Results of formulas may be out of date because Excel is not set to calculate automatically. Click here or press F9 to recalculate manually."
Also, Formulas --> Calculation --> Calculation Options is already set to Automatic.
I have tried executing Application.Calculation = xlCalculationAutomatic from the immediate window with no effect.
I cannot seem to turn the automatic calculation back on.
I saw in an earlier post a recommendation to review this cite: Excel Status Bar shows 'Calculate' - Decision Models. None of those conditions apply
Thanks in advance for any help
Code:
Sub OverlappingProps()
Dim cell As Object
Dim cell2 As Object
Dim iRows As Integer
Dim iOR As Integer 'holds Overlap Replacement col value
Application.Calculation = xlManual
iRows = Range(Sheet3.Cells(3, 12), Sheet3.Cells(3, 12).End(xlDown)).Count
'Find "Overlap Replacement" col number
iOR = 1
For Each cell In Range(Sheet3.Cells(3, 140), Sheet3.Cells(3, 140).End(xlToRight))
If cell.Value = "Overlap Replacement" Then
iOR = cell.Column
End If
Next cell
If iOR = 1 Then
iOR = Application.InputBox("Select Overlap Replacement cell.", "Cannot find 'Overlap Replacement'", Type:=8).Column
End If
'find and replace duplicate invoices
For Each cell In Range(Sheet3.Cells(4, iOR), Sheet3.Cells(iRows, iOR)) 'column EL "Overlap Replacement"
If InStr(1, LCase(cell), "overlap") > 0 Then
'loop through row containing "overlap"
For Each cell2 In Range(Sheet3.Cells(cell.Row, 22), Sheet3.Cells(cell.Row, iOR - 1)) 'range = row in the earn out table
'if the cell > 0 and the cell above it is > 0 and the column heading is not "Total" then replace cell
If cell2 > 0 And cell2.Offset(-1, 0) > 0 And InStr(1, Sheet3.Cells(3, cell2.Column), "Total") = 0 Then
cell2 = 0
End If
Next cell2
End If
Next cell
Application.Calculation = xlCalculationAutomatic
End Sub