预期结束声明 [英] Expected End of Statement

查看:139
本文介绍了预期结束声明的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

好的,我使用了一个建议的公式,工作得很好,应该没有问题,但现在我收到这个错误:

Ok, I have used a formula that was suggested that works well, should work without an issue but now I am getting this error:


预期结束声明

Expected End of Statement

这是公式

 Range("B4").FormulaR1C1 = "=IF(RC[-1]="T",VLOOKUP(RC[7],treatlookup,11,FALSE),VLOOKUP(RC[7],itemlookup,22,FALSE))"

不知道发生了什么,为什么会发生。任何建议。

Not sure what is going on, why it is happening. Any suggestions.

谢谢,

推荐答案

将其加倍(T)(T):

Range("B4").FormulaR1C1 = "=IF(RC[-1]=""T"",VLOOKUP(RC[7],treatlookup,11,FALSE),VLOOKUP(RC[7],itemlookup,22,FALSE))"
                                      ^^^
                                       |
                                      Here

Excel正试图将开头的报价与 = IF ,找到下一个双引号,它位于T,该部分(= IF(RC [-1] =)不是一个有效的语句,它们可以让它们单独考虑它们,使它们能够正确地嵌入到公式中。

Excel is trying to pair the opening quote at "=IF with the next double-quote it finds, which is at "T", and that portion ("=IF(RC[-1]=") isn't a valid statement. Doubling them tells Excel to consider them separately, allowing them to be embedded in the formula correctly.

(当您收到消息时,您会看到错误,如果您查看它所指示的代码,那么我发现它)。

(The error is highlighted for you when you get the message, if you look at the code it's indicating; that's how I spotted it.)

这篇关于预期结束声明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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