Sub Del_Lab()
Dim xC As Range, xR As Range, xU As Range
For Each xR In ActiveSheet.UsedRange.Columns(1).Cells
If xR <> "物品編號" Or xR.Row <= 4 Then GoTo 101
Set xC = xR(-2, 1).Resize(4)
If xU Is Nothing Then Set xU = xC Else Set xU = Union(xU, xC)
101: Next
If Not xU Is Nothing Then xU.EntireRow.Delete
End Sub作者: man65boy 時間: 2018-9-21 11:51
Sub Del_Lab()
Dim xC As Range, xR As Range, xU As Range
For Each xR In ActiveSheet.UsedRange.Columns(1).Cells
If xR <> "日期" Or xR.Row <= 4 Then GoTo 101
Set xC = xR(-3, 1).Resize(5)
If xU Is Nothing Then Set xU = xC Else Set xU = Union(xU, xC)
101: Next
If Not xU Is Nothing Then xU.EntireRow.Delete
End Sub作者: hcm19522 時間: 2018-9-22 11:12