VBA Error Handling Multiple times
I have an issue. I have values in a workbook that are getting read into an
array. The values come from an XML list so sometimes can be numbers or
text, and if they are numbers in text format ("1" for example), they need
to be converted to number format, so I multiply them by 1. If the value is
text "LS" for example, I am trying to use an error handler to keep the
value as "LS".
I have developed the code below: It works once, but the next time I use a
similar method (with 'Dummy2') the code it produces a 'Type Mismatch'
error.
On Error GoTo Dummy1
For i = 1 To nrows1 - 1
If (Worksheets("Import").Cells(i + 1, 26) * 1 = "") Then
Dummy1:
Table1(i, 1) = Worksheets("Import").Cells(i + 1, 26)
Else
Table1(i, 1) = Worksheets("Import").Cells(i + 1, 26) * 1
End If
Next
On Error GoTo 0
I also tried Clearing Err after the above code with no success.
Please help!
No comments:
Post a Comment