我需要帮助。 我希望在一个包含4位小数的列中显示每个百分比数字。
我试过这样:
Sub test()
Set bereich = Range("J1:J100")
For Each Cell In bereich
If Zelle = "0.00%" Then NumberFormat = "0.0000%"
Next Cell
End Sub
但它不起作用。 你能救我吗?
谢谢!
答案 0 :(得分:0)
尝试以下代码:
Sub test()
Dim bereich As Range, Cell As Range
Set bereich = Range("J1:J100")
For Each Cell In bereich
If Cell.NumberFormat = "0%" Then Cell.NumberFormat = "0.0000%"
Next Cell
End Sub
答案 1 :(得分:0)
我插入数据时看起来像这样。我想找到每一个"%"在这一列中,当有一个我想要显示相同的数字,但有四个小数。如果已有四位小数,则不应添加更多小数。