|
Sub 删除行()
Dim ar As Variant
Dim br()
With Sheet1
r = .Cells(Rows.Count, 1).End(xlUp).Row
.Range("d2:d" & r) = Empty
ar = .Range("a1:d" & r)
ReDim br(1 To UBound(ar), 1 To UBound(ar, 2))
For i = 2 To UBound(ar)
If Trim(ar(i, 1)) <> "" Then
sl = Application.CountIf(.Range("a2:a" & i), ar(i, 1))
If sl <= 100 Then
n = n + 1
For j = 1 To 3
br(n, j) = ar(i, j)
Next j
br(n, 4) = sl
End If
End If
Next i
.Range("a2:d" & r) = Empty
If n <> "" Then .[a2].Resize(n, UBound(br, 2)) = br
End With
MsgBox "ok!"
End Sub
|
评分
-
1
查看全部评分
-
|