Sub macro1() Dim arr, i% arr = Array(1, 2, 3, 4, 5, 6) On Error Resume Next i = WorksheetFunction.Match(9, arr, 0) If i > 0 Then MsgBox "存在" Else MsgBox "不存在" End Sub
Sub macro1() Dim arr, i% arr = Array(1, 2, 3, 4, 5, 6) On Error Resume Next i = WorksheetFunction.Match(9, arr, 0) If i > 0 Then MsgBox "存在" Else MsgBox "不存在" End Sub
转载于:https://www.cnblogs.com/lxshanye/archive/2013/01/26/2877935.html