Hello.
I would like to create a macro that would take data from "Sheet1" and add it under the existing data in "Sheet2" and roll off 1 weeks' worth of information from "Sheet2" at the same time. At any one time I would like Sheet2 to contain only 13 weeks of data, the current week (imported) and past twelve weeks (remove the old 14th week). The macro I have written is below. I would like the flexibility of not running the macro on a specific day. Can someone help? Thank you.
Sub DeleteRows()
Dim LR As Long, I As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
LR = Range("B" & Rows.Count).End(xlUp).Row
For I = LR To 1 Step -1
If Range("B" & I).Value <= Date - 93 Then Rows(I).Delete
Next I
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub
I would like to create a macro that would take data from "Sheet1" and add it under the existing data in "Sheet2" and roll off 1 weeks' worth of information from "Sheet2" at the same time. At any one time I would like Sheet2 to contain only 13 weeks of data, the current week (imported) and past twelve weeks (remove the old 14th week). The macro I have written is below. I would like the flexibility of not running the macro on a specific day. Can someone help? Thank you.
Sub DeleteRows()
Dim LR As Long, I As Long
Application.ScreenUpdating = False
Application.Calculation = xlCalculationManual
LR = Range("B" & Rows.Count).End(xlUp).Row
For I = LR To 1 Step -1
If Range("B" & I).Value <= Date - 93 Then Rows(I).Delete
Next I
Application.ScreenUpdating = True
Application.Calculation = xlCalculationAutomatic
End Sub