M
mikelee101
Hello,
I am having trouble with error handling. Not sure how much of the code to
include here, as I can’t really tell where the issue is. Here’s the sub
routine where it’s breaking down:
===========
MoveData:
On Error GoTo BadProjectName
ToRowNum = Application.WorksheetFunction.Match(ProjNme,
ToRng.Columns(1).Cells, 0)
On Error GoTo IrregularVendor
ToColNum = Application.WorksheetFunction.Match(VendNme, ToRng.Rows(1).Cells,
0) ***err on this line***
On Error GoTo 0
ToRng.Cells(ToRowNum, ToColNum).Value = Rslt
IrregularVendor:
On Error GoTo 0
Return
============
The problem is that, the second time that it encounters an irregular vendor,
I get a run time error (Unable to get the Match property of the
WorksheetFunction class). The fact that it works once leads me to believe
that some sort of setting is being retained, but I can't figure out what it
could be. I’ve tried inserting err.clear in various places, with no luck.
If anyone has any suggestions, please let me know.
Excel07, XPPro, VB6.5
I am having trouble with error handling. Not sure how much of the code to
include here, as I can’t really tell where the issue is. Here’s the sub
routine where it’s breaking down:
===========
MoveData:
On Error GoTo BadProjectName
ToRowNum = Application.WorksheetFunction.Match(ProjNme,
ToRng.Columns(1).Cells, 0)
On Error GoTo IrregularVendor
ToColNum = Application.WorksheetFunction.Match(VendNme, ToRng.Rows(1).Cells,
0) ***err on this line***
On Error GoTo 0
ToRng.Cells(ToRowNum, ToColNum).Value = Rslt
IrregularVendor:
On Error GoTo 0
Return
============
The problem is that, the second time that it encounters an irregular vendor,
I get a run time error (Unable to get the Match property of the
WorksheetFunction class). The fact that it works once leads me to believe
that some sort of setting is being retained, but I can't figure out what it
could be. I’ve tried inserting err.clear in various places, with no luck.
If anyone has any suggestions, please let me know.
Excel07, XPPro, VB6.5