|
楼主 |
发表于 2018-10-11 14:38
|
显示全部楼层
[广告] Excel易用宝 - 提升Excel的操作效率 · Excel / WPS表格插件 ★ 免费下载 ★ ★ 使用帮助★
我修改成3个条件
结果无法实现。。。
Sub vv_Click()
Application.ScreenUpdating = False
Set Rng = Nothing
With Sheets("vTigerReport")
arr = .[a1].CurrentRegion
dt = CDate(Year(Date) - 2 & "-" & Month(Date) & "-" & Day(Date))
For j = 3 To UBound(arr)
If dt - arr(j, 7) >= 0 Or arr(j, 6) = "Cancelled" Or arr(j, 6) = "Rejected" Or arr(j, 9) = "EN" Then
If Rng Is Nothing Then
Set Rng = .Cells(j, 1)
Else
Set Rng = Union(Rng, .Cells(j, 1))
End If
End If
Next j
If Not Rng Is Nothing Then Rng.EntireRow.Delete
End With
Sheets("vTigerReport").Select
Range("A2:C2").Select
Selection.AutoFill Destination:=Range("A2:C30000")
Sheets("vTigerReport").Calculate
Application.ScreenUpdating = True
End Sub
求助 |
|