- ©«¤l
- 192
- ¥DÃD
- 15
- ºëµØ
- 0
- ¿n¤À
- 194
- ÂI¦W
- 0
- §@·~¨t²Î
- windows
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¤k
- µù¥U®É¶¡
- 2016-9-22
- ³Ì«áµn¿ý
- 2020-8-28
|
¦^´_ 22# c_c_lai
¨SÃö«YC¤j¨ä¹ê³o¥u¬O§Ú¦Û¤v·Qª¾¹D¦³¨S¦³³o³¡¤À¥i¥HÀ³¥Î¦Ó¤wXD- Sub WIP()
- Dim r%, i%, Arr As Variant
- Dim rng As Range, reg As New RegExp
-
- With reg ' reg : : RegExp/IRegExp2
- .IgnoreCase = True ' IgnoreCase = True : Boolean
- ' S Äæ (Recipe) ¿z ¥X LS1T | LS1N | TR | BK | VQ ¦r¦ê¡A¨ä¾lªº¤£n
- .Pattern = "LS1T|LS1N|TR|BK|VQ" ' Pattern = "LS1T|LS1N|TR|BK|VQ" : String
- End With
-
- With Worksheets("WIP")
- Set rng = .Rows(1)
- Arr = .[A1].CurrentRegion.Value ' Arr : : Variant/Variant(1 to 1249, 1 to 27)
-
- For i = 2 To UBound(Arr) ' UBound(Arr) = 1249 : Long
-
- ' (reg.test(Arr(i, 19)) : Arr(i, 19) = "TR1T0.03" (True) / = "PK1T0" (False)) : Boolean
- If Arr(i, 10) = "G" And Arr(i, 18) = "R" And reg.test(Arr(i, 19)) Then
- ' N Äæ (Trackin time) ªº®É¶¡¡A¥H·í«e¨t²Î®É¶¡ + 4HRS
- If IsDate(Arr(i, 16)) Then
- If Arr(i, 16) >= Now And Arr(i, 16) < DateAdd("h", 4, Now) Then ' ·í¤U®É¶¡ +4Hrs
- If Len(Arr(i, 21)) > 0 And Right(.Cells(i, 9), 1) <> "«æ³f" Then
- .Cells(i, 9) = .Cells(i, 9) & "«æ³f" ' ½T»{¬O§_¬°«æ³f³æ¸¹
- End If
-
- Set rng = Union(rng, .Rows(i))
- End If
- ' N Ä椺ªÅ¥ÕµL¸ê®Æ
- ElseIf Len(Arr(i, 16)) = 0 Then
- ' ¦p "U" Äæ («æ³f³æ¸¹)¡A¦³¥ô¦óÈ¡A¦b "I" Äæ (Schedule) ¥[¤W * ¸¹
- If Len(Arr(i, 21)) > 0 And Right(.Cells(i, 9), 2) <> "«æ³f" Then
- .Cells(i, 9) = .Cells(i, 9) & "«æ³f" ' ½T»{¬O§_¬°«æ³f³æ¸¹
- End If
- ' Cells(i, 9) = .Cells(i, 9) & "«æ³f"
- ' .Cells(i, 9) = Left(.Cells(i, 9), Len(.Cells(i, 9)) - 1) & "«æ³f" ' ½T»{¬O§_¬°«æ³f³æ¸¹
- ' End If
-
- Set rng = Union(rng, .Rows(i))
- End If
- End If
- Next
- End With
-
- With Worksheets("Sheet1")
- .[A1].CurrentRegion.ClearContents ' ²M°£¤W¤@¦¸ªºµe±
- rng.Copy .Range("A1")
- End With
- End Sub
½Æ»s¥N½X C¤j§Ú"WIP"ªº MA code"O"Äæ ¥i¥H§â"TR±Æ¾÷&²£¥X" ªº ¾÷¥x½s¸¹"BÄæ"
"TR±Æ¾÷&²£¥X" BÄæ¤Uªº ¸¹½X ·|¥X²{¦b WIP"ªº MA code"O"Äæ
¥i¥HÂo±¼¶Ü~
¥Ø«e§Ú¥u¾Ç«O¯dªº¤èªkXD
¥ýÂo±¼¦b°µ§Ú«á±¼gªº¿z"G"¸ò"R"¥X¨Ó
If Arr(i, 10) = "G" And Arr(i, 18) = "R" And reg.test(Arr(i, 19)) Then |
|