| the following logic can be problematic On Error Resume Next If range("name") = 22 then DoSomething else DoSomethingElse End if If the range("name") is in error (#NA, #VALUE, #NAME, #DIV/0 etc.) the next line after the "if" will be executed. Instead use: On Error Resume Next x = range("name") if err = 0 then if x = 22 then DoSomething else DoSomethingElse end if else DoErrorCode end if |