- ©«¤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
|
- 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, 14)) Then
- If Arr(i, 14) >= Now And Arr(i, 14) < DateAdd("h", 4, Now) Then ' ·í¤U®É¶¡ +4Hrs
- If Len(Arr(i, 21)) > 0 And Right(.Cells(i, 9), 1) <> "XXXXXX" Then
- .Cells(i, 9) = .Cells(i, 9) & "XXXXXX" ' ½T»{¬O§_¬°«æ³f³æ¸¹
- End If
-
- Set rng = Union(rng, .Rows(i))
- End If
- ' N Ä椺ªÅ¥ÕµL¸ê®Æ
- ElseIf Len(Arr(i, 14)) = 0 Then
- ' ¦p "U" Äæ («æ³f³æ¸¹)¡A¦³¥ô¦óÈ¡A¦b "I" Äæ (Schedule) ¥[¤W * ¸¹
- If Len(Arr(i, 21)) > 0 And Right(.Cells(i, 9), 1) <> "XXXXXXXX" Then
- .Cells(i, 9) = .Cells(i, 9) & "XXXXXX"
- 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 ¦^´_ 4# c_c_lai
³oÃä§Ú¤£À´·N«ä
§Ú¤£¬O§â¬P¸¹§ï±¼¤F -> §Ú§ï¦¨XXXXX
¦ý¬O¨q¥X¨Ó¤@¼Ë¦³¬P¸¹C~ |
|