1,453
社区成员
发帖
与我相关
我的任务
分享dim sh1,sh2
dim i%,j%
set sh1=worksheets("甲")
set sh2=worksheets("乙") '若表名不一样或不在一个文件中请自己百度
for i=1 to sh1.UsedRange.Rows.Count '取sh1的最大行数
for j=1 to sh2.UsedRange.Rows.Count '取sh2的最大行数
if sh1.cells(i,1)=sh2.cells(j,1) and sh1.cells(i,2)=sh2.cells(j,2) then
sh1.cells(i,3)=sh2.cells(j,3)
end if
next
next