[英]Excel VBA check if cell words contained in another cell
以下UDF()将确定单元格Little中的所有单词是否出现在单元格Big中 :
Public Function AreIn(Little As String, Big As String) As Boolean
Dim good As Boolean, aLittle, aBig, L, B
AreIn = False
aLittle = Split(LCase(Little), " ")
aBig = Split(LCase(Big), " ")
For Each L In aLittle
good = False
For Each B In aBig
If L = B Then
good = True
End If
Next B
If good = False Then Exit Function
Next L
AreIn = True
End Function
这里的“单词”是一组不包含空格的字符。 该测试不区分大小写。 例:
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.