答案 0 :(得分:0)
听起来你正在J列中骑车并在G栏中寻找一场比赛。我已经通过在G栏骑行并在第J栏中寻找一场比赛来扭转局面。一旦找到一场比赛,它就会被移动到列H,从而将其从列J中删除。
Sub match_em_up()
Dim rwg As Long, rwj As Long
With Worksheets("Sheet1")
For rwg = 2 To .Cells(Rows.Count, "G").End(xlUp).Row
If CBool(Application.CountIf(.Columns("J"), .Cells(rwg, "G").Value2)) Then
rwj = Application.Match(.Cells(rwg, "G").Value2, .Columns("J"), 0)
.Cells(rwg, "H") = .Cells(rwj, "J").Value2
.Cells(rwj, "J").ClearContents
End If
Next rwg
End With
End Sub
在:
后: