Hello 9599lorenzo,
Keep a count of the array elements that were not found. Compare that to the Ubound of the array. If they are equal then no matches were found.
Example
Dim sString As String
Dim MyAr
Dim i As Long
Dim delRange As Range, aCell As Range
Dim NotFound As Long
Dim ws As Worksheet
Set ws = ThisWorkbook.Sheets("Sheet1")
'~~> Add more to the list here separated by "/"
sString = "KIX/NRT/CGO"
MyAr = Split(sString, "/")
With ws
For i = LBound(MyAr) To UBound(MyAr)
Set aCell = .Range("G5:K5").Find(What:=MyAr(i), LookIn:=xlValues, _
LookAt:=xlWhole, SearchOrder:=xlByRows, SearchDirection:=xlNext, _
MatchCase:=False, SearchFormat:=False)
If Not aCell Is Nothing Then
Sheet1.Range("f24").Value = "***ADDITIONAL ADDRESSES NEEDED"
Sheet1.Range("f12").Value = "***ADDITIONAL ADDRESSES NEEDED"
Sheet1.Range("f14").Value = "***ADDITIONAL ADDRESSES NEEDED"
Else
NotFound = NotFound + 1
End If
Next i
If NotFound = UBound(MyAr) Then
MsgBox "No Matches were Found.", vbExclamation
Exit Sub
End If
End With
Bookmarks