Vba Numberformat多项条件格式化单元格值 [英] Vba Numberformat muliple condtions to format cell value

查看:120
本文介绍了Vba Numberformat多项条件格式化单元格值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的所有人,我想根据单元格"值格式化我的单元格.有3种可能的条件:

Dear all i want to format my cell based on the Cell value. There are 3 possible Conditions:

  1. 像元大于0.05->值应保持不变,但应设置为0.0
  2. 单元小于0.05->值应替换为字符串"a.C."
  3. 单元格为零->值应替换为破折号"

我找到了解决方案破折号,可以将其与数字格式结合使用

I found thisSolution for the dashes and could combine it with the number formating

.NumberFormat = "0.0;[=0]---"

这有效.但是,如果我添加一个附加参数,则vba代码会中断.

This works. but if i add an additonal argument the vba code breaks.

.NumberFormat = "0.0;[=0]---;[<0.05]a.C."

不起作用.您介意告诉我我在做什么错吗?

Does not work. Would you mind telling me what i am doing wrong?

提前谢谢

推荐答案

请问该订单似乎起作用的原因是什么

FOr what ever reason this Order seems to work:

.NumberFormat ="[= 0] ---; [<0.05]""a.C.""; 0.0

.NumberFormat = "[=0]---;[<0.05] ""a.C."";0.0 "

这篇关于Vba Numberformat多项条件格式化单元格值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆