我正在尝试在我的电子表格中运行一个方程式,该方程式将通过“I”列并删除从现在起 90 天内没有到期日期的每一行......换句话说,我正在尝试将我的电子表格格式化为只需给我一份清单,列出未来 90 天内到期的所有物品。我放星星的那一行是我难以插入方程的地方。我不知道如何插入方程,但如果它自己在单元格中运行,它看起来像这样 =IF(AND(I11-900),1,0)=1。我会将 Q11 更改为什么,以便在运行方程式时它将应用于 I 列中的每个单元格,而不仅仅是 I 11
Sub DeleteNow()
Dim Firstrow As Long
Dim Lastrow As Long
Dim Lrow As Long
Dim CalcMode As Long
Dim ViewMode As Long
With Application
CalcMode = .Calculation
.Calculation = xlCalculationManual
.ScreenUpdating = False
End With
With Sheets("Copy")
.Select
ViewMode = ActiveWindow.View
ActiveWindow.View = xlNormalView
.DisplayPageBreaks = False
Firstrow = .UsedRange.Cells(1).Row
Lastrow = .UsedRange.Rows(.UsedRange.Rows.Count).Row
For Lrow = Lastrow To Firstrow Step -1
With .Cells(Lrow, "I")
If Not IsError(.Value) Then
If ******************** Then .EntireRow.Delete
End If
End With
Next Lrow
End With
ActiveWindow.View = ViewMode
With Application
.ScreenUpdating = True
.Calculation = CalcMode
End With
End Sub