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.
我有两张纸,Sheet1,Sheet2
表 1:
A | B ----- 123 | 456 | 789 |
表 2:
A | B ----- 123 | DATA1 789 | DATA2 456 | DATA3
我希望 Sheet1 具有以下输出:
A | B ----- 123 | DATA1 456 | DATA3 789 | DATA2
我有一个非常基本的VB知识,我该如何做到这一点?
Sheet1,单元格 B1:=VLOOKUP(A1,Sheet2!$A$1:$B$3,2,0)并向下拖动应该会产生所需的结果
=VLOOKUP(A1,Sheet2!$A$1:$B$3,2,0)
编辑(VBA 解决方案): Sheet1.Range("B1:B3").Formula = "=VLOOKUP(A1,Sheet2!$A$1:$B$3,2,0)"
Sheet1.Range("B1:B3").Formula = "=VLOOKUP(A1,Sheet2!$A$1:$B$3,2,0)"