|
[广告] VBA代码宝 - VBA编程加强工具 · VBA代码随查随用 · 内置多项VBA编程加强工具 ★ 免费下载 ★ ★ 使用手册★
Option Explicit
Sub test2()
Dim ar, i&, j&, p&, rng As Range
With [A1].CurrentRegion
ar = .Value
For i = UBound(ar) To 2 Step -1
If InStr(ar(i, 2), "冲正") Then
p = i
If rng Is Nothing Then
Set rng = .Rows(p)
Else
Set rng = Union(rng, .Rows(p))
End If
For j = p To 2 Step -1
If ar(j, 3) = ar(p, 4) Then
Set rng = Union(rng, .Rows(j))
Exit For
End If
Next j
End If
Next i
End With
If Not rng Is Nothing Then rng.EntireRow.Delete
End Sub |
评分
-
1
查看全部评分
-
|