我可以使用 Array
使用 Like
比较多个标准陈述
例子:
LCase(Cells(lig, 2)) Like Array("object**", "**cash**", "lobby**")
最佳答案
你不能。您必须遍历数组并单独检查数组的每个项目。
Dim Criteria() As Variant
Criteria = Array("object**", "**cash**", "lobby**")
Dim Criterion As Variant
For Each Criterion In Criteria
If LCase(Cells(lig, 2)) Like Criterion Then
'...
End If
Next Criterion
关于excel - 我可以使用数组来使用 like 运算符比较多个条件吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/55920641/