Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试编写一个 VBA 函数,它将动态 vlookup 命令插入整个列(列“E”)。我的目标是从另一张表(称为“WBTS”)复制数据。不幸的是,语法似乎是非法的。“LastRow”表示该列中最终占用的行。
For X = 2 To LastRow2 Cells(X, 5).Value = "=VLOOKUP(D"&X",WBTS!$D$2:$I$466,6,FALSE)" Next X
尝试这个
Cells(X, 5).formula = "=VLOOKUP(D" & X & ",WBTS!$D$2:$I$466,6,FALSE)"