Excel Vba:公式中的双引号? [英] Excel Vba: Double quotes in formula?

查看:688
本文介绍了Excel Vba:公式中的双引号?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不知道在公式中处理双引号的语法.

I don't know the syntax for handling double quotation marks within a formula.

这是我的代码:

ActiveCell.Formula = "=IF($W9="A",1,IF($W9="B",2, IF($W9="C",3,0))))"

非常感谢您的帮助.

推荐答案

您需要将公式更改为

ActiveCell.Formula = "=IF($W9=""A"",1,IF($W9=""B"",2, IF($W9=""C"",3,0)))"

因此,首先需要双引号,并且在这种情况下,还需要计算("和)"的数量

So, first you need to double quote and in your case you also need to count the number of "(" and ")"

这篇关于Excel Vba:公式中的双引号?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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