我可以做这样的事情吗?
Sub RTtest2()
Dim i As Variant
Dim ArrTest As Variant
ArrTest = Array("tag:(1???)?EX???", "tag:(3???)?EX???", "tag:(5???)?EX???")
For Each i In ArrTest
If "tag:(1001)FEXFFF" Like ArrTest(i) Then
'Do something
Else
'Do something
End If
Next i
End Sub
具体来说,我可以将数组与like运算符一起使用吗?
答案 0 :(得分:0)
这里是将“ Like”用于数组的示例...在这种情况下,该数组称为“ TagForms”
If wkbCompiledData_Table(1).Sheets(1).Cells(r, 2).Value Like TagForms(i) Then
wkbCompiledData_Table.Add Workbooks.Open(FileName:=wkbCompiledData_Table(1).Sheets(1).Cells(r, 1).Value, WriteResPassword:="x")
End If