- ©«¤l
- 38
- ¥DÃD
- 4
- ºëµØ
- 0
- ¿n¤À
- 65
- ÂI¦W
- 0
- §@·~¨t²Î
- Window7
- ³nÅ骩¥»
- office2010
- ¾\ŪÅv
- 20
- ©Ê§O
- ¨k
- ¨Ó¦Û
- Taipei
- µù¥U®É¶¡
- 2011-12-16
- ³Ì«áµn¿ý
- 2013-12-13
|
¦^´_ 1# adam2010
¸Õ¸Õ¬Ý§a- Private Sub CommandButton1_Click()
- Dim LotID As Range, Tagt As Range, Qty As Range
- Dim a, TalQty
- With sheet2
- For Each LotID In .Range("A2:A" & .[A65536].End(xlUp).Row)
-
- For Each Tagt In .Range("B" & LotID.Row & ":J" & LotID.Row)
-
- If Tagt <> "" Then
-
- With Sheet1
-
- a = Application.Match(LotID, .[A:A], 0)
- aa = Application.CountIf(.[A:A], LotID)
- TalQty = 0
-
- For Each Qty In .Range("D" & a & ":D" & (a + aa - 1))
-
- If Qty.Offset(, 1) <> "" Then GoTo ntxa
-
- Qty = Qty + TalQty
-
- If Qty < Tagt Then
-
- Qty.Offset(, 1) = sheet2.Cells(1, Tagt.Column)
- TalQty = Qty
-
- Else
-
- Qty.Offset(, 1) = sheet2.Cells(1, Tagt.Column)
- GoTo ntla
- End If
- ntxa:
- Next Qty
- ntla:
- End With
- End If
-
- Next Tagt
-
- Next LotID
- End With
-
- End Sub
½Æ»s¥N½X |
|