如何在Excel VBA中结合FormulaArray和FormulaLocal选项? [英] How to combine FormulaArray and FormulaLocal options in Excel VBA?

查看:330
本文介绍了如何在Excel VBA中结合FormulaArray和FormulaLocal选项?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用VBA代码行将VBA代码内部的函数发送到单元格,如下所示:

I am sending functions inside VBA code to the cells with a VBA-code line like below:

Sheets("Sheet1").Range("B2").FormulaLocal = "=somefunctions_in_local_language"

我正在使用FormulaLocal选项,因为单元格中的功能使用的是本地语言,而不是英语.

I am using FormulaLocal option because the functions in cells are in the local language, not in English.

现在,我想发送数组函数,并且应该使用FormulaArray来执行此操作.但是,即使数组函数也将使用本地语言.我猜我应该以某种方式将FormulaArrayFormulaLocal组合在一起,但是如何?

Now I want to send array functions, and I am supposed to use FormulaArray to do this. However, even the array functions will be in the local language. I guess I am supposed to combine both FormulaArray and FormulaLocal somehow, but how?

我试图找到是否有类似FormulaArrayLocal的东西,但是没有这样的东西.有什么想法吗?

I tried to find if there is something like FormulaArrayLocal, but there is not such a thing. So any idea?

推荐答案

该链接未给出直接答案,但我确实找到了解决方法:

That link didn't give a direct answer, but I did find a solution:

Sheets("Sheet1").Range("B2").FormulaLocal = "=somefunctions_in_local_language"
Sheets("Sheet1").Range("B2").FormulaArray = Sheets("Sheet1").Range("B2").Formula

在第二行中只能是.Formula.如果使用.FormulaLocal,则会出现错误.

It should only be .Formula in the second line. If you use .FormulaLocal, then you get an error.

这篇关于如何在Excel VBA中结合FormulaArray和FormulaLocal选项?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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