cortexnotion
Board Regular
- Joined
- Jan 22, 2020
- Messages
- 150
- Office Version
- 2013
- Platform
- Windows
Hi All
I have the below code, but I have found Instr is picking up partial matches inside words, when I need it to match to whole words only inside the string. Could anyone suggest how to achieve this please?
Thanks
I have the below code, but I have found Instr is picking up partial matches inside words, when I need it to match to whole words only inside the string. Could anyone suggest how to achieve this please?
Thanks
VBA Code:
For i = LBound(ArrIN) To UBound(ArrIN)
If InStr(ArrIN(i, 2), "CO ") = 0 And InStr(ArrIN(i, 2), "CU ") = 0 And InStr(ArrIN(i, 2), "CDIWE") = 0 And InStr(ArrIN(i, 8), "Water") > 0 And _
ArrIN(i, 9) > 0 And ArrIN(i, 16) > 0 Then
For b = LBound(BucketArray) To UBound(BucketArray)
If InStr(ArrIN(i, 2), BucketArray(b)) > 0 Then GoTo NR1
Next b
For m = LBound(MatchArray) To UBound(MatchArray)
If InStr(ArrIN(i, 3) & ArrIN(i, 4), MatchArray(m)) > 0 Then GoTo NR1
Next m
For x = 0 To UBound(ColAry)
ArrOUT(o, x + 1) = ArrIN(i, ColAry(x))
Next x
o = o + 1
End If
NR1: Next i