|
本帖最后由 junjinling 于 2019-3-14 00:03 编辑
判断产线滞留品的问题。
《外观后》是最后一道工序
从最后一道工序判定,例如第六行,最后一道工序是 焊接后,则判定 焊接后与 打线后 这两者的日期,若是焊接后的日期大于 打线后的日期+2
则判定为滞留品
再看第七行,最后一道工序是 打端子工序,而前一道工序是水槽,水槽日期是空白,则用 打端子后的日期与 封入检查后日期对比,若是打端子日期
大于 封入检查后日期+3,则判定滞留品。
以上滞留品的这3个字,再V列写入。
我的代码是
Sub 按钮825_Click()
Application.ScreenUpdating = False
Dim j As Integer
Dim i As Integer
Dim n As Integer
n = WorksheetFunction.CountA(Range("B6:B3000"))
Range("g6:M1000").Interior.ColorIndex = 0
Range("V6:v1000").ClearContents
For j = 1 To n
For i = 13 To 8 Step -1
If Cells(j + 5, i) <> "" Then
If Cells(j + 5, i - 1) <> "" Then
If Cells(j + 5, i) > Cells(j + 5, i - 1) + Cells(4, i) Then
Cells(j + 5, 22) = "停滞品"
Exit For
Else
Exit For
End If
Else
If Cells(j + 5, i) > Cells(j + 5, i - 2) + Cells(4, i) Then
Cells(j + 5, 22) = "停滞品"
Exit For
Else
Exit For
End If
End If
End If
Next
Next
Application.ScreenUpdating = True
ActiveWorkbook.Save
MsgBox ("更新并保存完毕")
End Sub
当遇到 500行的时候就会很卡很卡。
麻烦大家了。
|
|