Sub tt() Dim i As Integer For i = 2 To ActiveSheet.UsedRange.Rows.Count If Sheets(1).Cells(i, 6) <> "" Then Dim j As Integer For j = 2 To 153 If Sheets(1).Cells(i, 6) = Sheets(2).Cells(j, 1) Then If Sheets(1).Cells(i, 7) = Sheets(2).Cells(j, 2) Then Sheets(1).Cells(i, 6) = "" Sheets(1).Cells(i, 7) = "" Sheets(1).Cells(i, 9) = Sheets(2).Cells(j, 1) Sheets(1).Cells(i, 10) = Sheets(2).Cells(j, 2) Sheets(2).Cells(j, 3) = "Find" Else Sheets(1).Cells(i, 9) = Sheets(2).Cells(j, 1) Sheets(1).Cells(i, 10) = Sheets(2).Cells(j, 2) Sheets(2).Cells(j, 3) = "Find" End If End If Next j End If Next i End Sub
慎用
Sub tt() Dim i As Integer For i = 2 To ActiveSheet.UsedRange.Rows.Count If Cells(i, 6) <> "" Then Dim n As Integer For n = 0 To 15 If Cells(i, 6) <> Cells(i - 1, 6) And Cells(i, 6) = Cells(i + n, 6) Then If Cells(i, 10) <> "" Then Cells(i, 10) = Cells(i, 10) & "/" & Cells(i + n, 7) End If If Cells(i, 10) = "" Then Cells(i, 10) = Cells(i + n, 7) End If End If Next n End If Next i End Sub
将举证信息表,导出为EXCEL表,6列为标识码,7列为举证号。先以标识码排序,然后运行,在10列产生新的举证号,最后排序。