%REM Function LSCLng Description: wrapper to covert to long, returns -999 for error %END REM Function LSCLng(numTxt As String) As Long Dim lsDbl As Double ' temporary double to be rounded to integer On Error GoTo FErrorHandler If (numTxt = "") Then LSCLng = 0 Exit Function End If ' convert lsDbl = CDbl(numTxt) lsDbl = Round(lsDbl, 0) LSCLng = CLng(lsDbl) FExit: Exit Function FErrorHandler: Print |(LSCLng) Unexpected error, expected incoming string "| & numTxt & |" to be a number. Error: | & Cstr(Err) & ", line: " & Cstr(Erl) & ", error: " & Error$ & "." LSCLng = -999 Resume FExit End Function