Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ignore 'Number Stored as Text' Error in Excel programmatically using VBA

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.

like image 430
Foreever Avatar asked Nov 28 '22 07:11

Foreever


1 Answers

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.

like image 159
Gary's Student Avatar answered Dec 05 '22 15:12

Gary's Student