excel 高级筛选是怎么用的?我想选出两列数据中完全相同的数据出来,该怎么做?请看图,谢谢

2025-01-20 23:52:04
推荐回答(2个)
回答1:

Sub aa()
Dim rng, rnge As Range
Dim i As Integer
i = 1
For Each rng In range("d"&activesheet.usedrange.rows.count)
For Each rnge In range("g"&activesheet.usedrange.rows.count)
If rng.Value = rnge.Value Then
ActiveSheet.Range("k" & i).Value = rng
i = i + 1
End If
Next
Next
End Sub
如果数据太多建议改成数组

回答2: