switters_aka
Board Regular
- Joined
- Oct 26, 2010
- Messages
- 118
Hello all, I am running this code to refresh a sheet which has a vba function to calculate values in a cell. For some reason, the function is constantly producing #value errors but on refresh, the function works. The problem is, the refresh sub() is doesn't always work. If I modify it in some way, even if it means removing a blank line, then it works. It's one of those intermittent problems which does your head in. Any ideas where I might be going wrong?
Code:
Public Sub refresh()
Application.Calculation = xlCalculationManual
Application.Calculate
Application.Calculation = xlCalculationAutomatic
Application.ScreenUpdating = True
End Sub