由于你没提到结果存放在哪儿, 我就把它们存放在e5里面了. 不喜欢的话可以改, 很简单的.在excel里面按alt+f11, 然后双击左边窗口中的的sheet1, 复制以下代码, 按f5运行.或者回到excel中, 按alt+f8, 然后选中"calc"宏运行即可.public sub calc() dim la as long dim lc as long dim found as long la = 1 do until **empty(cells(la, 1)) lc = 1 do until **empty(cells(lc, 3)) if cells(la, 1) = cells(lc, 3) then found = found + 1 cells(found, 5) = "a" & la & "-" & "c" & lc & " = " & cells(la + 1, 1) - cells(lc + 1, 3) end if lc = lc + 1 loop la = la + 1 loop cells(found + 1, 5) = "找到 " & found & " 个" msgbox "计算完毕!"end sub 20210311