|
诸位大侠:
我在编辑VBA语句时,要把对负数的颜色设置为红色:
Range("F22").Select
Selection.NumberFormatLocal = "#,##0_ ;[Red]-#,##0 "
可是因为Office中英文版的关系, 当别人使用该宏时, 会出错, Red应该改用汉字才能通过.
请问大家,如何修改以上语句,使得中英文都能运行通过. 谢谢
直接判断数字,然后通过颜色参数值来做,参考代码 - Range("F22").Select
- With Selection
- If .Value < 0 Then
- .Font.ColorIndex = 3
- End If
- End With
复制代码
|
|