- Sub qcw()
- Application.ScreenUpdating = False
- Dim cell As Range, r%, I%
- I = Range("a65536").End(xlUp).Row
- Set rng = Range("a1:a" & I)
- For Each cell In rng
- If Left(cell, 1) = "M" And Format(Left(cell.Offset(0, 2), 11), "yyyymmdd") = Format(Date - 1, "yyyymmdd") Then
- r = cell.Row
- Rows("2:" & r).Copy Sheet2.Range("A" & Sheet2.Range("a65536").End(xlUp).Row + 1)
- Rows("2:" & r).Delete
- If r > 1 Then Exit Sub
- End If
- Next
- Application.ScreenUpdating = True
- End Sub
复制代码 |