【发布时间】:2021-03-16 11:17:12
【问题描述】:
亲爱的,我想根据单元格值格式化我的单元格。有 3 种可能的条件:
Cell is larger than 0.05 -> the Value should stay the same but be fromated to 0.0
Cell is smaller than a variable (called Threshold) -> the Value should be replaced with a String "a.C."
Cell is Zero -> the Value should be replaced with a Dash"
我想出了如何在没有 here 的变量的情况下做到这一点。讨论如何在vba中添加文本字符串.numberformathere!
这个:
.NumberFormat = "[=0]---;[<0.05] ""a.C."";0.0 "
确实有效,而这个:
Dim threshold as Double
threshold = 0.05
.NumberFormat = "[=0]---;[<threshold] ""a.C."";0.0 "
不起作用。我想我需要将一个特殊的变量拼写错误传递给“
非常感谢您的提示! 提前谢谢你
【问题讨论】:
标签: excel vba number-formatting