|
- Sub test0()
- Dim ar, ymd(2) As Date
- Dim i As Long, j As Long, k As Long
- Application.ScreenUpdating = False
- ymd(0) = CDate(Range("G4").Value)
- ymd(1) = DateAdd("D", -1, ymd(0))
- ymd(2) = DateAdd("D", 365 + 1, ymd(0))
- k = 1
- ar = Range("A7:F" & Cells(Rows.Count, "B").End(xlUp).Row)
- For i = 2 To UBound(ar)
- If ar(i, 2) > ymd(1) Then
- If ar(i, 2) < ymd(2) Then
- k = k + 1
- For j = 1 To UBound(ar, 2)
- ar(k, j) = ar(i, j)
- Next
- End If
- End If
- Next
- With Range("H7")
- .CurrentRegion.Clear
- With .Resize(k, UBound(ar, 2))
- .Borders.LineStyle = xlContinuous
- .Font.Size = 9
- .Value = ar
- End With
- End With
- Application.ScreenUpdating = True
- Beep
- End Sub
复制代码 |
评分
-
1
查看全部评分
-
|