yinkajewole
Active Member
- Joined
- Nov 23, 2018
- Messages
- 281
How can i return as true when all my values are all found in an array?
Assuming your array is in A1:A6, and the values in B1:B3, you could use this array formula
Code:=COUNT(MATCH(B1:B3,A1:A6,0))=COUNT(B1:B3)
Public Function MatchAll(ByRef Target As Range, ByRef Values As Range) As Boolean
Dim cell As Range
MatchAll = True
For Each cell In Values.Cells
If IsError(Application.Match(cell.Value, Target, 0)) Then
MatchAll = False
Exit Function
End If
Next cell
End Function