【发布时间】:2019-02-09 00:02:56
【问题描述】:
我正在使用Application.match 函数来查找我要查找的列标题的列号。如果没有一个标题匹配,我想要一个自定义的弹出 MsgBox。
在它到达 IfError 语句之前,Excel 会停止我的程序并显示一个 MsgBox,它说没有匹配项
col_num = Application.WorksheetFunction.Match("wanted name", theDataWS.Rows(1), 0)
If IsError(col_num) Then
MsgBox "Please rename your column name to 'wanted name'"
End If
【问题讨论】:
标签: excel vba error-handling