现将A1单元填上“黄色”,再运行。
Sub ck()
Dim I
Application.DisplayAlerts = False
With Sheets("在库")
For I = .[A65536].End(xlUp).Row To 2 Step -1
If .Range("A" & I).Interior.ColorIndex = .Cells(1, 1).Interior.ColorIndex Then
.Range("A" & I & ":N" & I).Copy Sheets("出库").Range("A65536").End(3)(2)
.Rows(I).Delete
End If
Next
End With
With Sheets("出库")
.Cells.Interior.Pattern = xlNone
For I = .Range("O65536").End(3).Row + 1 To .Range("A65536").End(3).Row
.Cells(I, "O") = Date - 1
Next
End With
Application.DisplayAlerts = True
MsgBox "操作完毕"
End Sub