Format Entire Excel Column Using C#

匆匆过客 提交于 2019-12-12 02:03:20

问题


I have column F that I want to format as money so add $ sign and commas. It's to late for me to attempt to format it in the Source so I was going to format it via C# after all data has been written to Excel. I know you can use this syntax to change a column to a date - what would be the appropriate syntax for money?

range.EntireColumn.NumberFormat = "MM/DD/YYYY";


回答1:


Sorry for my stupidity on this one...it's actually quiet simple

range3.EntireColumn.NumberFormat = "$#,##0.00";



来源:https://stackoverflow.com/questions/24972371/format-entire-excel-column-using-c-sharp

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!