允许用户访问错误检查选项。
语法
表达式.Errors
表达式 一个代表 Range 对象的变量。
说明
引用 Errors 对象可查看与错误检查选项相关联的索引值列表。
示例
在本例中,单元格 A1 中放置了文本格式的数字。然后,ET 判断单元格 A1 中的数字是否为文本格式,并通知用户。
| 示例代码 |
function CheckForErrors(){
Range("A1").Formula = "'12"
if(Range("A1").Errors.Item(xlNumberAsText).Value2 == true) {
MsgBox("The number is written as text.")
}
else {
MsgBox("The number is not written as text.")
}
}
|