I have an array Cdo in the form (j,0)(i,0). There are two exceptions: the addresses (j,0) or (j,0)(0), usually empty, may contain a string with an error message [never both at the same time].
Want to pass through those errors without generating a subscript out of range while also documenting it to the cleaned up array, Breaks (in two dimensions, (j,i)).
For j = 0 to Symbol
If TypeName(Cdo(j,0)) <> "String" Then
If TypeName(Cdo(j,0)(0)) <> "String" Then
For i = 0 to UBound(Cdo(j,0))
Breaks(j,i) = Cdo(j,0)(i,0)
Next i
End if
Breaks(j,1) = "#N/A"
End if
Breaks(j,1) = "#TrancheDef"
Next j
I tried IsEmpty and looking for a string (shown), but they both throw errors when looking somewhere not dimensioned. I can’t change the array as it comes in – how can I test whether a location, e.g. (403)(0)(0) “exists” so to speak?
Alternatively:
I could just check if Cdo(j,0)(i,0) exists – if not, then it should be one of the other two cases. Still revolves around the same fundamental question.
Something like the above should work. Play with it to make it do what you want.