Excel VBA使用本地化的RC公式进行条件格式设置吗? [英] Excel VBA use localized RC formula for Conditional Formatting?

查看:286
本文介绍了Excel VBA使用本地化的RC公式进行条件格式设置吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用的是波兰语Excel,因此 R [-2] C为 W [-2] C。



在每个地方,我只尝试使用VBA接受的RC表示法。

但是对于条件格式,只有 W [-2] C有效。




  • 问: W [-2] C符号在非抛光版本的Excel中可以使用吗?

  • 问:有什么选择?



编辑:



以下是适用于我的语言版本的代码:

  .FormatConditions.Delete 
.FormatConditions.add类型:= xlExpression,Formula1:= = WK [-2] -WK [-1]< WK
与.FormatConditions(1).Interior
。 PatternColorIndex = xlAutomatic
.ThemeColor = xlThemeColorAccent2
.TintAndShade = 0

结尾


解决方案

用于条件格式或验证规则的语言独立Excel公式



写您的具有英文功能名称的公式,带有A1-或R1C1-引用。将此公式作为 cell 公式分配给适当的单元格。这可能是您要格式化的单元格,也可能是任何未使用的单元格。然后从该单元格中读取FormulaLocal-这是您将用于格式设置的公式。将用作翻译器的单元格的公式设置为空白。


I'm using polish Excel so "R[-2]C" is "W[-2]C".

In every place I tried VBA only accepted RC notation. Which is good since it will work regardless of language version of Excel.

But for conditional formatting only "W[-2]C" works.

  • Q: Will "W[-2]C" notation work in non-polish version of Excel?
  • Q: What alternative is there for it?

Edit:

Here is the code that works for MY language version:

.FormatConditions.Delete
.FormatConditions.add Type:=xlExpression, Formula1:="=WK[-2]-WK[-1]<WK"
With .FormatConditions(1).Interior
    .PatternColorIndex = xlAutomatic
    .ThemeColor = xlThemeColorAccent2
    .TintAndShade = 0
End With

解决方案

Language independent Excel formulae for use in conditional formatting or validation rules

Write your formula with english function names, with either A1- or R1C1-references. Assign this formula as the cell formula to an appropriate cell. This could be the cell you are about to format, or any unused cell. Then read the FormulaLocal from that cell - this is the formula you are going to use for formatting. Set the formula of the cell you used as translator to blank.

这篇关于Excel VBA使用本地化的RC公式进行条件格式设置吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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