使用VBA以编程方式忽略Excel中存储的数字错误 [英] Ignore 'Number Stored as Text' Error in Excel programmatically using VBA

查看:933
本文介绍了使用VBA以编程方式忽略Excel中存储的数字错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在单元格中存储诸如'001234'的文本。我已将此单元格的数字格式设置为文本。存储后,单元格左上角以绿色三角形的形式显示存储为文本的数字错误。这是非常令人不安的,我希望以编程方式删除。

I want to store text such as '001234' in a cell. I have set the number format of this cell to text. After storing, an error 'Number Stored as Text' is shown in the form of a green triangle at the top left corner of the cell. It is very disturbing and I want it to be removed programmatically.

推荐答案

考虑:

Sub Macro1()
    Application.ErrorCheckingOptions.NumberAsText = False
End Sub

当我开始在一台新电脑上工作时,这是一个更大的宏的一行,用于配置Excel。

This is a single line of a much larger macro to configure Excel when I begin working on a new computer.

这篇关于使用VBA以编程方式忽略Excel中存储的数字错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆