简体   繁体   English

VBA中的Excel IF公式

[英]Excel IF Formula in VBA

I have the below piece of vba code that doesnt work.我有下面一段不起作用的vba代码。

Range(C5:C & Range("D" & Rows.Count).End(xlUp).Row).Formula =IF(B4=""X"",'HUB'!$F$5,'HUB'!F$4$)&""-""&""Q""&HUB!B$2$&"" QA""&HUB!C$6$"

I think there is sth wrong with the formula and with & sign.我认为公式和 & 符号有问题。 Do you have any suggestion?你有什么建议吗?

'HUB'!F$4$ The $ placement is incorrect. 'HUB'!F$4$ $位置不正确。

Change it to $F$4 and check the other notations ad well;将其更改为$F$4并检查其他符号广告; I noticed more of the same.我注意到更多相同的。

Try adding double quotes like this :尝试添加这样的双引号:

在此处输入图片说明

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM