Trying to add only unique values to an array...
This worked:
This did not:
The question is, why? It seemed to add every value it found. I tried with and without the Val() operator. The data its reading from is stored as text, though its all numbers.
Any ideas? Obviously its working now, I'm just trying to figure out where I went wrong on the 2nd block of code.
This worked:
Code:
On Error Resume Next
matcherr = wsf.Match(zsd17.Cells(iInv, 8).Value, invNums, 0)
If Err.Number = 0 Then
invFound = True
Else
invFound = False
End If
On Error GoTo 0
This did not:
Code:
'check currently evalued line against array of unique invoices
'For ckInvs = LBound(invNums, 1) To UBound(invNums, 1)
' If Val(invNums(ckInv)) = Val(zsd17.Cells(iInv, 8).Value) Then
' invFound = True
' Exit For
' End If
'Next ckInvs
The question is, why? It seemed to add every value it found. I tried with and without the Val() operator. The data its reading from is stored as text, though its all numbers.
Any ideas? Obviously its working now, I'm just trying to figure out where I went wrong on the 2nd block of code.