我用VBA开始冒险。我想在VBA上创建公式,使用vlookup,但是这个问题出了问题。 另外,我想为单元格实现vlookup 将填充来自不同列的单元格
(例如,如果WB_WS_Pricing.Range(" A4")<> 0然后 WB_WS_PRICING.Range(" CX4")=" = IFNA(VLOOKUP(发送!E4,DATA!A:I,9,0),"")&#34 ;
子公式()
Set WB_CMSO_MASS_IBERIA = ThisWorkbook
Set WB = ThisWorkbook
Set WB_WS_PRICING = WB.Sheets("Pricing")
Set WB_WS_HEADER = WB.Sheets("Header")
Set WB_WS_DATA = WB.Sheets("DATA")
Set WB_WS_Extension = WB.Sheets("Extension")
Set WB_WS_DELIVERING = WB.Sheets("Delivering")
WB_WS_PRICING.Range("CX4") = "=IFNA(VLOOKUP(Delivering!E4,DATA!A:I,9,0),"")"
End Sub
Enyone知道出了什么问题?对我来说,公式看起来很好......
答案 0 :(得分:0)
你需要在公式中使用额外的引号来逃避公式中的双引号(即&#34;&#34;&#34;&#34;&#34;&#34;)< / p>
WB_WS_PRICING.Range("CX4") = "=IFNA(VLOOKUP(Delivering!E4,DATA!A:I,9,0),"""")"