excel中的难题,高手请进!
如果表1中的数据在a1:a4,有10行。表2中的数据在a1:a7,有50行。那么如下代码能把找到的内容放入表3的a1:a4。public sub find() for i = 1 to 10 for j = 1 to 50 if sheet1.cells(i, 1) = sheet2.cells(j, 7) and sheet1.cells(i, 2) = sheet2.cells(j, 3) and sheet1.cells(i, 3) = sheet2.cells(j, 4) and sheet1.cells(i, 4) = sheet2.cells(j, 5) then sheet1.rows(i).copy sheet3.rows(i) end if next j next iend sub具体根据你的实际修改即可。按alt+f11,打开vba编辑器,插入一个模块,把代码放里面,把光标停在代码中间,按f5运行。 20210311