|
mmc998 发表于 2015-12-4 19:41
就按此法填,重复的数保留一个
Sub Click()
Dim A, B, i, j, k
i = Range("a655536").End(xlUp).Row
Range([b31], Range("ad" & i)).ClearContents
A = Range("a1:ad" & i)
For i = 31 To UBound(A)
ReDim B(1 To UBound(A, 2))
For j = 2 To UBound(A, 2)
If Len(A(i - j + 1, 1)) Then B(A(i - j + 1, 1)) = A(i - j + 1, 1)
Next j
j = 1
For k = 1 To UBound(B)
If Len(B(k)) Then j = j + 1: A(i, j) = B(k)
Next k
Next i
[a1].Resize(UBound(A), UBound(A, 2)) = A
End Sub
虽然去重复了,但重新排序了,行吗?
|
|