数字格式化在excel Vb.Net [英] Number Formatting in excel Vb.Net
本文介绍了数字格式化在excel Vb.Net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
col(ADJ)ToString()其中col是DataTable oject。
解决方案
我不确定VB,但在C#中将是:
worksheet.Cells [C3]。NumberFormat =0.00
或者
worksheet.Cells [A:Z]。NumberFormat =0.00
或
Range.NumberFormat = 0.00
Can someone give me some code to set the cell of an excel spreadsheet to a number format that use a max of 2 decimal places. Or would it work better it I change the data I am putting into the cell to a proper format? Here is a sample of data that is going in. Right now its going in as a string... col("ADJ").ToString() where col is a DataTable oject.
解决方案
I'm not sure about VB, but in C# it would be:
worksheet.Cells["C3"].NumberFormat = "0.00"
or
worksheet.Cells["A:Z"].NumberFormat = "0.00"
or
Range.NumberFormat = "0.00"
这篇关于数字格式化在excel Vb.Net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文