Sub DeleteMatch() Dim lastRow As Integer Dim i As Integer Dim j As Integer

lastRow = Cells(Rows.Count, "H").End(xlUp).Row

For i = lastRow To 1 Step -1
    For j = 1 To lastRow
        If Cells(i, "H").Value = Cells(j, "L").Value Then
            Cells(i, "H").Delete Shift:=xlUp
            Exit For
        End If
    Next j
Next i

End Sub

写一个excel的vba逻辑是检查H列的数据找到单元格中和L列相同的字符并删除

原文地址: https://www.cveoy.top/t/topic/bjgq 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录