答案1
这是我编写的一个宏,它可以满足您的要求。它已经假设了两个排序列表。修改它以适合您的列,删除不需要的列,并可能在开头添加排序功能。尽情享受吧!
Sub compareCheckNumbers()
' 宏1 宏
' 比较支票号码,如果行匹配则删除
rowNum = 3
Do
If (Range("C" & rowNum).Value > Range("L" & rowNum).Value) Then
'shift down first set
Range("A" & rowNum & ":G" & rowNum).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ElseIf (Range("C" & rowNum).Value < Range("L" & rowNum).Value) Then
'else shift down second set
Range("J" & rowNum & ":P" & rowNum).Select
Selection.Insert Shift:=xlDown, CopyOrigin:=xlFormatFromLeftOrAbove
ElseIf (Range("C" & rowNum).Value = Range("L" & rowNum).Value And Range("D" & rowNum).Value = Range("M" & rowNum).Value And Range("F" & rowNum).Value = Range("O" & rowNum).Value) Then
'delete outstanding data if matching
Range("A" & rowNum & ":G" & rowNum).Select
Selection.ClearContents
End If
rowNum = rowNum + 1
Loop While (Range("C" & rowNum).Value <> "")
子目录结束