在C#中从Excel工作表中选择后保持领先零 [英] Keep Leading Zero After Select From Excel Sheet In C#
本文介绍了在C#中从Excel工作表中选择后保持领先零的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
Hello All Experts,
我在Excel工作表中有一个列,通过定义自定义格式处理其中的前导零件
但在功能栏中它删除了前导零和
当我从C#Code中选择那张表时它还删除了领先的零...
有没有办法处理这个挑战.......
谢谢大家...
Hello All Experts ,
I Have An Column In Excel Sheet That Handle Leading Zero In It By Define Custom Format
But In Function Bar It Removes Leading Zero And Also
When I Select That Sheet From C# Code It Removes Leading Zero Too...
Is There Any Way To Handle This Challenge .......
Thank You All ...
推荐答案
试试这样。在数字前加一个引号。
'01
Try like this. Put a single quote before number.
'01
如果你想用前导零存储号码,你需要将其视为文本。
请阅读有关单元格格式的信息: Range.NumberFormat属性(Excel) [ ^ ]
If you want to store number with leading zeros, you need to treat it as a text.
Please, read about cell formats: Range.NumberFormat Property (Excel)[^]
这篇关于在C#中从Excel工作表中选择后保持领先零的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文