用VBA , 按ALT+F11, 在ThisWorkbook中放出如下代码,ALT+F8 执行Public Sub abc()Dim a As Long, b As Long, c As Longa = 1c = 1Do While Cells(a, 1)""b = 1 Do While Cells(b, 2)""If Cells(a, 1) = Cells(b, 2) Then Exit Dob = b + 1Loop If Cells(b, 2) = "" ThenCells(c, 3) = Cells(a, 1)c = c + 1End Ifa = a + 1LoopEnd Sub
|