更改 Excel 2007 中的数字格式
我有一个如下所示的 Excel 文件。我如何更改单元格格式,使其看起来与功能栏完全相同。而不是 3E-07
--> 0.000003
我不想更改小数位数,因为我只希望它具有所需的小数位数,这样末尾就不会出现多余的零。 例如,因为最小的数字有 7 个小数位,如果我将整列更改为 7 个小数位,像 6E-05 这样的数字将在末尾有两个额外的零 (0.0000600)。
我试图在宏观上做到这一点,因为有很多数字需要处理。我可以自己设置循环。
I have an Excel file that looks like this. How would I change the cell formatting so that it looks exactly like it does it the function bar. Instead of 3E-07
--> 0.000003
I don't want to change the decimal places because I only want it to have the number of decimal places it needs so there won't be extra zeroes at the end.
For example because the smallest numbers have 7 decimal places if I change the whole column to seven decimal places numbers like 6E-05 will have two extra zeroes (0.0000600) at the end.
I'm trying to do this on macro because there are a lot of numbers to go through. I can set up the loop myself.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
要修复所有列,请按照以下步骤操作: -
此数字格式问题是由于列大小而发生的。
要修复这种类型的数字格式“0.0000600”:-
然后它会解决您的格式问题。
To fix on all columns, follow below steps:-
This number format issue is occurred due to column size.
To fix this type of number format "0.0000600":-
Then it fix your format issue.
您已使用 VBA 标记了此问题,因此这里有两个 VBA 的示例 .自动调整方法。
对于整个工作表:
如果您的列已经达到您想要的宽度,您可以测试前 20 行,看看 .TEXT 属性 显示散列标记(例如# 或 Chr(35))符号。
后者使用 .CurrentRegion 属性定义要处理的单元格范围 从原点开始扩展,直到遇到完全空白的行和列。
You have tagged this question with VBA so here are two examples of VBA's .AutoFit method.
For the entire worksheet:
If you have columns that are already the width you want you could test the first 20 rows to see if the .TEXT property is displaying the hash mark (e.g. # or Chr(35)) symbol.
The latter defined the range of cells to work on using the .CurrentRegion property which expands from its origin until it meets a fully blank row and column.