- ©«¤l
- 2035
- ¥DÃD
- 24
- ºëµØ
- 0
- ¿n¤À
- 2031
- ÂI¦W
- 0
- §@·~¨t²Î
- Win7
- ³nÅ骩¥»
- Office2010
- ¾\ŪÅv
- 100
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2012-3-22
- ³Ì«áµn¿ý
- 2024-2-1
|
¥»©«³Ì«á¥Ñ c_c_lai ©ó 2016-12-2 10:43 ½s¿è
- Sub AuditCustPkg(Adt_Rng As Range)
- Dim c As Range, frstAddr As String, tf As Boolean
- Dim cts As Integer, ct2 As Integer
- Dim Arr As Variant, Ar2 As Variant, Ar3 As Variant
-
- With Sheets("Cus²½X")
- Set c = .[B:B].Find(Adt_Rng.Offset(, -1).Value, , , 1) ' "TR±Æ¾÷&²£¥X" Customer ¤ñ¹ï "Cus²½X" CUST_GROUP
-
- If Not c Is Nothing Then
- frstAddr = c.Address
- Do
- If IsEmpty(Arr) Then ReDim Arr(1 To 1) Else ReDim Preserve Arr(1 To UBound(Arr) + 1)
- Arr(UBound(Arr)) = Array(c.Offset(, -1).Text, c.Text)
-
- Set c = .[B:B].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
- End With
-
- If Not IsEmpty(Arr) Then
- With Sheets("§÷®Æ")
- For cts = LBound(Arr) To UBound(Arr)
- Set c = .[M:M].Find(Arr(cts)(0), , , 1) ' "Cus²½X" CODE ¤ñ¹ï "§÷®Æ" CUST_CODE
-
- If Not c Is Nothing Then ' Arr(cts)(0) = "ASM" : Variant/String
- frstAddr = c.Address
- Do
- ' ¥H "TR±Æ¾÷&²£¥X" ªº "F"¡B"G"¡B"H" ¬°±ø¥ó¡A¥h "§÷®Æ" §ä¨ì¹ïÀ³ªº¼Æ¾Ú¡C
- ' ²Ä 1 ºØ (¬Û¦P Cust (c.Value) & PKG (c.Offset(, 3)) & B/S (c.Offset(, 4)) & L/C (c.Offset(, 5)))
- If c.Offset(, 3) = Adt_Rng.Value And c.Offset(, 4) = Adt_Rng.Offset(, 1).Value And c.Offset(, 5) = CStr(Adt_Rng.Offset(, 2).Value) Then
- If IsEmpty(Ar2) Then ReDim Ar2(1 To 1) Else ReDim Preserve Ar2(1 To UBound(Ar2) + 1)
- Ar2(UBound(Ar2)) = Array(c.Text, Arr(cts)(1), c.Offset(, 3).Text, c.Offset(, 4).Text, c.Offset(, 5).Text, c.Offset(, 39).Text, c.Offset(, 40).Text)
- End If
-
- Set c = .[M:M].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
-
- If Not IsEmpty(Ar2) Then
- For ct2 = LBound(Ar2) To UBound(Ar2)
- ' ¥H ¤u§@ªí "TR±Æ¾÷&²£¥X" ªº "F"¡B"G"¡B"H" ¬°±ø¥ó¡A ¥h ¤u§@ªí "§÷®Æ" §ä¨ì¹ïÀ³ªº¼Æ¾Ú¡F
- ' µM«á§ä¨ì³oµ§¼Æ¾Úªº "CARRIER1 P/N"¡AµM«á¥un¤@¼Ë "CARRIER1 P/N" ªº³£¦C¥X¨Ó¡C
- Set c = .[BA:BA].Find(Ar2(ct2)(6), , , 1) ' CARRIER1 P/N ("BA") Ar2(ct2)(6) = "4100998111" : Variant/String
-
- If Not c Is Nothing Then ' PKG (c.Offset(, -37)) ¡B BODU_SIZE (c.Offset(, -36))
- frstAddr = c.Address ' CUST_CODE (c.Offset(, -40).Text)¡B, LEAD_COUNT (c.Offset(, -35).Text)
- Do ' "BA" Äæ¦ì«üªº¬OÄx¤l¡A¥un¬O¦b¦PÓÄx¤l¤ºªº´N¥i¥H¡Anªº´N¬O·Qª¾¹D¥Î³oÓÄx¤lªº¦³þ¨Ç¤H¡C
- ' ¦P¨B¦a±Æ°£ì¥ý¦b ¤u§@ªí "TR±Æ¾÷&²£¥X" ÂI¿ïªº Package¡C(Customer¡BPackage¡BBodysize)
- ' ×¥¿¥H "Cus²½X" Arr ¤§²Ä¤@²Õ (Arr(1)(0)) §@¬°§PÂ_¨Ì¾Ú¡C
- tf = (c.Offset(, -40).Text = Arr(1)(0) And c.Offset(, -37) = Adt_Rng.Value And c.Offset(, -36) = Adt_Rng.Offset(, 1).Value)
- If Ar2(ct2)(1) <> "" And tf = False Then
- If IsEmpty(Ar3) Then ReDim Ar3(1 To 1) Else ReDim Preserve Ar3(1 To UBound(Ar3) + 1)
- Ar3(UBound(Ar3)) = Array(Ar2(ct2)(1), c.Offset(, -37).Text, c.Offset(, -36).Text, c.Offset(, -35).Text, c.Text)
- End If
- Set c = .[BA:BA].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
- Next ct2
- End If
- Next cts
- End With
-
- If Not IsEmpty(Ar3) Then CustPkg (Ar3)
- End If
-
- Sub AuditCustPkg(Adt_Rng As Range)
- Dim c As Range, frstAddr As String, tf As Boolean
- Dim cts As Integer, ct2 As Integer
- Dim Arr As Variant, Ar2 As Variant, Ar3 As Variant
-
- With Sheets("Cus²½X")
- Set c = .[B:B].Find(Adt_Rng.Offset(, -1).Value, , , 1) ' "TR±Æ¾÷&²£¥X" Customer ¤ñ¹ï "Cus²½X" CUST_GROUP
-
- If Not c Is Nothing Then
- frstAddr = c.Address
- Do
- If IsEmpty(Arr) Then ReDim Arr(1 To 1) Else ReDim Preserve Arr(1 To UBound(Arr) + 1)
- Arr(UBound(Arr)) = Array(c.Offset(, -1).Text, c.Text)
-
- Set c = .[B:B].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
- End With
-
- If Not IsEmpty(Arr) Then
- With Sheets("§÷®Æ")
- For cts = LBound(Arr) To UBound(Arr)
- Set c = .[M:M].Find(Arr(cts)(0), , , 1) ' "Cus²½X" CODE ¤ñ¹ï "§÷®Æ" CUST_CODE
-
- If Not c Is Nothing Then ' Arr(cts)(0) = "ASM" : Variant/String
- frstAddr = c.Address
- Do
- ' ¥H "TR±Æ¾÷&²£¥X" ªº "F"¡B"G"¡B"H" ¬°±ø¥ó¡A¥h "§÷®Æ" §ä¨ì¹ïÀ³ªº¼Æ¾Ú¡C
- ' ²Ä 1 ºØ (¬Û¦P Cust (c.Value) & PKG (c.Offset(, 3)) & B/S (c.Offset(, 4)) & L/C (c.Offset(, 5)))
- If c.Offset(, 3) = Adt_Rng.Value And c.Offset(, 4) = Adt_Rng.Offset(, 1).Value And c.Offset(, 5) = CStr(Adt_Rng.Offset(, 2).Value) Then
- If IsEmpty(Ar2) Then ReDim Ar2(1 To 1) Else ReDim Preserve Ar2(1 To UBound(Ar2) + 1)
- Ar2(UBound(Ar2)) = Array(c.Text, Arr(cts)(1), c.Offset(, 3).Text, c.Offset(, 4).Text, c.Offset(, 5).Text, c.Offset(, 39).Text, c.Offset(, 40).Text)
- End If
-
- Set c = .[M:M].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
-
- If Not IsEmpty(Ar2) Then
- For ct2 = LBound(Ar2) To UBound(Ar2)
- ' ¥H ¤u§@ªí "TR±Æ¾÷&²£¥X" ªº "F"¡B"G"¡B"H" ¬°±ø¥ó¡A ¥h ¤u§@ªí "§÷®Æ" §ä¨ì¹ïÀ³ªº¼Æ¾Ú¡F
- ' µM«á§ä¨ì³oµ§¼Æ¾Úªº "CARRIER1 P/N"¡AµM«á¥un¤@¼Ë "CARRIER1 P/N" ªº³£¦C¥X¨Ó¡C
- Set c = .[BA:BA].Find(Ar2(ct2)(6), , , 1) ' CARRIER1 P/N ("BA") Ar2(ct2)(6) = "4100998111" : Variant/String
-
- If Not c Is Nothing Then ' PKG (c.Offset(, -37)) ¡B BODU_SIZE (c.Offset(, -36))
- frstAddr = c.Address ' CUST_CODE (c.Offset(, -40).Text)¡B, LEAD_COUNT (c.Offset(, -35).Text)
- Do ' "BA" Äæ¦ì«üªº¬OÄx¤l¡A¥un¬O¦b¦PÓÄx¤l¤ºªº´N¥i¥H¡Anªº´N¬O·Qª¾¹D¥Î³oÓÄx¤lªº¦³þ¨Ç¤H¡C
- ' ¦P¨B¦a±Æ°£ì¥ý¦b ¤u§@ªí "TR±Æ¾÷&²£¥X" ÂI¿ïªº Package¡C(Customer¡BPackage¡BBodysize)
- ' ×¥¿¥H "Cus²½X" Arr ¤§²Ä¤@²Õ (Arr(1)(0)) §@¬°§PÂ_¨Ì¾Ú¡C
- tf = (c.Offset(, -40).Text = Arr(1)(0) And c.Offset(, -37) = Adt_Rng.Value And c.Offset(, -36) = Adt_Rng.Offset(, 1).Value)
- If Ar2(ct2)(1) <> "" And tf = False Then
- If IsEmpty(Ar3) Then ReDim Ar3(1 To 1) Else ReDim Preserve Ar3(1 To UBound(Ar3) + 1)
- Ar3(UBound(Ar3)) = Array(Ar2(ct2)(1), c.Offset(, -37).Text, c.Offset(, -36).Text, c.Offset(, -35).Text, c.Text)
- End If
- Set c = .[BA:BA].FindNext(c)
- Loop While Not c Is Nothing And c.Address <> frstAddr
- End If
- Next ct2
- End If
- Next cts
- End With
-
- If Not IsEmpty(Ar3) Then CustPkg (Ar3)
- End If
-
- Set Arr = Nothing
- Set Ar2 = Nothing
- Set Ar3 = Nothing
- End Sub
½Æ»s¥N½X |
-
-
a.rar
(2.79 KB)
|