A common mistake is to to turn off calculation and allow for the code to take a path where it will not be turned back on again.
For example the following code turns off calculation. It then ask the user to input a date. If the user does not enter a correct date the programmer has decided that the user should be alerted and the procedure to be stopped.
Code
Sub MyProcedure()
Dim MyDate As Date
Application.Calculation = xlManual
MyDate = Application.InputBox("Enter A Date")
'If statement to check condition
If Not IsDate(MyDate) Then
'Alert the user they have entered an incorrect date
MsgBox "You Have Not Entered A Correct Date, Try Again", vbExclamation
'Dont want to continue because we dont have a correct date
Exit Sub
End If
'Carry Out The Proper Procedure
Range("A1").Value = MyDate
Application.Calculation = xlAutomatic
End Sub
Display More
The problem is calculation has not been turned back on. And the user may be looking at a uncalculated screen.
This would be a better option:
Code
Sub MyProcedure()
Dim MyDate As Date
Application.Calculation = xlManual
MyDate = Application.InputBox("Enter A Date")
'If statement to check condition
If Not IsDate(MyDate) Then
'Alert the user they have entered an incorrect date
MsgBox "You Have Not Entered A Correct Date, Try Again", vbExclamation
'Dont want to continue because we dont have a correct date
GoTo ExitSub
End If
'Carry Out The Proper Procedure
Range("A1").Value = MyDate
ExitSub:
Application.Calculation = xlAutomatic
End Sub
Display More