Ignore 'Number Stored as Text' Error in Ex

2019-04-11 19:53发布

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.

3条回答
Root(大扎)
2楼-- · 2019-04-11 20:06

You can select the range you want to work and then put for example (now added speechmarks):

Range("A1:Z20").Application.ErrorCheckingOptions.NumberAsText = False
查看更多
Ridiculous、
3楼-- · 2019-04-11 20:09

Consider:

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

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

查看更多
爷、活的狠高调
4楼-- · 2019-04-11 20:09

Alternately, instead of formatting the cell as text, you could format the cell as 000000 to get the leading 0's to show.

查看更多
登录 后发表回答