vba 如何将 NumberFormat 设置为具有 0 个小数位的数字
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/8153800/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-08 12:10:42 来源:igfitidea点击:
How to set NumberFormat to Number with 0 decimal places
提问by Bruno
The below VBA in MS Access is run to format my Excel sheet. However, it is formatting to Number with 2 decimal places. How do I specify that I want 0 decimal places?
运行 MS Access 中的以下 VBA 来格式化我的 Excel 工作表。但是,它正在格式化为带有 2 个小数位的数字。如何指定我想要 0 个小数位?
wb.Sheets(1).Range("K:AD").Formula = wb.Sheets(1).Range("K:AD").Value
wb.Sheets(1).Range("K:AD").NumberFormat = "Number"
回答by paulmorriss
wb.Sheets(1).Range("K:AD").NumberFormat = "0"