首页 > 解决方案 > 使用 VBA 的 Excel 单元格中的公式

问题描述

尝试使用 VBA excel 在单元格中添加 vlookup 公式,但出现运行时错误 1004。

我的代码:-

Range(Cells(2, AgtColV.Column), Cells(LastRowMerge, AgtColV.Column)).Formula = _

    "=IF(ISNA(VLOOKUP(RC[-1],'\\stor.site.com\s2\me\My Documents\[om_vlookup.xlsb]Agent_M'!$D:$E,2,0)),""NF"",VLOOKUP(RC[-1],'\\stor.site.com\s2\me\My Documents\[om_vlookup.xlsb]Agent_M'!$D:$E,2,0)

我认为问题是因为我在 $D:$E 中使用了 $

标签: excelvbavlookup

解决方案


推荐阅读