> 其他 >
excel去除重复 比如:A B C D 1 a1 b1 c1 d1 2 a2 b1 c1 d1 3 a3 b2 c2 c2 4 a4 b2 c2 c2
请问怎样可以把1/3,或2/4删除?
人气:141 ℃ 时间:2019-12-12 21:28:54
解答
用VBA方法解决,代码如下:
Sub 去除重复()

Sheets("sheet1").Select
i = 0
j = 0
k = 0
l = 0
m = 2
For i = 1 To 4
For j = 1 To 4
For k = m To 4
For l = 1 To 4
If Cells(k, l) = Cells(i, j) Then
Cells(k, l).Select
Selection.ClearContents
End If
Next l
Next k
Next j
m = m + 1
Next i

End Sub
推荐
猜你喜欢
© 2024 79432.Com All Rights Reserved.
电脑版|手机版