问题
Dear all i want to format my cell based on the Cell value. There are 3 possible Conditions:
- Cell is larger than 0.05 -> the Value should stay the same but be fromated to 0.0
- Cell is smaller than 0.05 -> the Value should be replaced with a String "a.C."
- Cell is Zero -> the Value should be replaced with a Dash"
I found thisSolution for the dashes and could combine it with the number formating
.NumberFormat = "0.0;[=0]---"
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?
Thank you in advance
回答1:
Edit:
FOr what ever reason this Order seems to work:
.NumberFormat = "[=0]---;[<0.05] ""a.C."";0.0 "
来源:https://stackoverflow.com/questions/65129793/vba-numberformat-muliple-condtions-to-format-cell-value