ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Numeric formats (https://www.excelbanter.com/excel-programming/282501-numeric-formats.html)

Vern Jorgensen

Numeric formats
 
Using OLE, I'm invoking Excel and opening a tab delimited
file. My problem is with cells that contain numbers.
Excel automatically removes leading and trailing zeroes
from cells that contain numbers. In many cases this data
represents text, such as a part number, which may contain
leading zeroes. I don't want these removed. In addition
I'd prefer that trailing zeroes on decimal numbers not be
truncated. Is there a way to tell Excel to treat the data
as text even if the contents is all numeric? I've tried
using the NumberFormat property, but I don't see any way
to prevent the removal of leading zeroes.

Thanks,
Vern

ashdata

Numeric formats
 
I am having exactly the same problem from Deplhi.

I have tried Numberformat:='Text' gives error 1900 in result
also tries :='@' no effect

Seen this problem reported in lots of places on the net but never wit
a suggested solution that was acknowledged as working.

Is there a solution

--
Message posted from http://www.ExcelForum.com



All times are GMT +1. The time now is 02:50 PM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com