Any ideas why, rather than returning to the output line, this just goes to the next error handler?
Say for example cells(count,1) produces an error, then it goes to the GeneralErrHandler. But when it gets to the resume statement, it simply goes to the DateErrHandler and then to outputline rather than straight to outputline??
Private Sub CBGetRates_Click()
Do While count < 10
errorflag = false
On error goto GeneralErrHandler:
input = cells(count,1)
count = count + 1
outputline:
if errorflag=true then
cells(count,2) = ErrorCode
end if
Loop
'Error handling
Exit Sub
GeneralErrHandler:
ErrorFlag = true
ErrorCode = "ERROR: "
Resume outputline:
DateErrHandler:
ErrorFlag = true
ErrorCode = "ERROR: Trade Date not found"
Resume outputline:
End Sub
Bookmarks