I am writing a function and having trouble. I have stripped out all but the troublesome line
Function TestFunction (Inputstr as string)
If IsErr( Application.WorksheetFunction.Find("*", InputStr) then
TestFunction = "There was an error."
Exit Function
End If
Test fuction = "There was no Errors."
End Function
The problem comes in that the function simply throws a value error and exits the function on the if statment line instead of proceeding to the next line. I have also tried replacing IsErr with IsError, and Application.WorksheetFunction.IsErr.
Any thoughts would be appreciated.
Function TestFunction (Inputstr as string)
If IsErr( Application.WorksheetFunction.Find("*", InputStr) then
TestFunction = "There was an error."
Exit Function
End If
Test fuction = "There was no Errors."
End Function
The problem comes in that the function simply throws a value error and exits the function on the if statment line instead of proceeding to the next line. I have also tried replacing IsErr with IsError, and Application.WorksheetFunction.IsErr.
Any thoughts would be appreciated.