- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 13
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-10-25
|
¶W·PÁÂluhpro¥S¡Aì¨Ó¥¨¶°¤]¥i¥H³o»ò¥Î¡A¿é¤J²Å¦Xªº¸ê®Æ«á¦Û°Ê¨q¥X¡A¯u¬OÅý¤p§Ì¡¨¤j¶}²´¬É¡¨
¥u¬O¤p§Ì©Ò¾Ç ...
p6703 µoªí©ó 2012-9-22 22:23
·í§PÂ_¥X³f¸ê®Æ¿é¤J§¹«á,
¤é´Á»P®Æ¸¹³¡¤À¬O±q¿é¤J°Ïª½±µ±a¹L¥h,¦Ó¥ý¥H®Æ¸¹¬° Key ¨Ì§Ç©¹¤U§ä²Å¦Xªº¥¼µ²PO¸ê®Æ(·í¤U¥¼¥æ¼Æ ¤£¬O 0 ªº),
§ä¨ì«á±N«È¤á PO ±a¹L¥h, ¦A±Npºâµ²ªG¤À§O±a¤J ·í¤U¥¼¥æ¼Æ »P ¥X³f¼Æ, §PÂ_¬O§_»Ý¥X³f¼Æ³£¤w§¹¦¨, Y¥¼§¹¦¨«hÄ~Äò¤Wz´`Àô.
luhpro¥S¡A¤p§Ì¹ê»Ú°õ¦æµo²{¦³¥H¤U°ÝÃD¡A¦A·Ð½Ð¨ó§U¸Ñ´b¡AÁÂÁÂ..
1.·s¼Wªºµ§¼Æ¸ê®Æ¤£·|®»¨ì
¦]PO·|³°Äò ...
p6703 µoªí©ó 2012-9-24 18:12
³o½T¹ê¬O¸Óµ{¦¡¨S¦³³B²zªº³¡¥÷,
1. Y¶ñ¸ê®Æ®É¨S¦³±N ´Áªì¥¼¥æ¼Æ ¤]¥[¶ñ¨ì ·í¤U¥¼¥æ¼Æ, ¨º»ò ·í¤U¥¼¥æ¼Æ ¬O 0 ¦ÛµM´N¤£·|¦³·s¥X³f¸ê®Æ¤F.
¥i©ó Sheets("¥¼µ²PO")¥[¤W :- Private Sub Worksheet_Change(ByVal Target As Range)
- With Target.Parent '©ó Sheets("¥¼µ²PO")
- If .Cells(Target.Row, 1) <> "" And .Cells(Target.Row, 2) <> "" And .Cells(Target.Row, 3) <> "" Then
- With .Cells(Target.Row, 3)
- .NumberFormat = "#,##0_ "
- .Offset(, 1).NumberFormat = "#,##0_ "
- .Offset(, 1) = .Value
- End With
- End If
- End With
- End Sub
½Æ»s¥N½X 2. ³oÓ³B²z¤W»Ýn¸û¦hªº°Ê§@,»Ýn¦A·Q¤@¤U, ±ßÂI¦APost.
luhpro¥S¡A¤p§Ì¶}©l¿é¤J¸ê®Æ¡A¤~²Ä¤Gµ§´N¶]¥X¥H¤U¿ù»~¡A½T©w¸ê®Æ¨Ã¥¼¥´¿ù¡A¦Ó"¥¼µ²PO"·í¤U¥¼¥æ¼Æ¤]¨S¿ù¡A¤£ ...
p6703 µoªí©ó 2012-9-25 11:13
³o¥i¯à¬O§A¸ê®Æ¦C¼Æ¶W¹L Integer ¥i³B²z½d³ò, §Ú±N iRow §ï¦¨ lRow ¦p¤U:- Private Sub Worksheet_Change(ByVal Target As Range)
- Dim lRow As Long
- Dim rStuff As Range
- Dim bChecked As Boolean
- Dim vPo, vBalance
-
- Set vPo = Sheets("¥¼µ²PO")
-
- With Target.Parent '©ó Sheets("¥X³f¼Æ¶q")
- If .Cells(Target.Row, 2) <> "" And .Cells(Target.Row, 3) <> "" Then
- lRow = IIf(.Cells(2, 5) = "", 2, .Cells(2, 5).End(xlDown).Row + 1)
- vBalance = .Cells(Target.Row, 3)
- Set rStuff = vPo.[A2] ' ©ó Sheets("¥¼µ²PO")
-
- Do While .Cells(Target.Row, 2) <> rStuff ' §ä¨ì¸Ó«È¤á
- Set rStuff = rStuff.Offset(1) ' ²¾¨ì¤U¤@µ§¸ê®Æ
- Loop
-
- Do
- Do While rStuff.Offset(, 3) <> 0 ' ÁÙ¦³©|¥¼¥X³fªº¸ê®Æ
- If vBalance > rStuff.Offset(, 3) Then ' ©|¥¼¥X³f¼Æ¶q¤j©ó·í¤U¥¼¥æ¼Æ
- Application.EnableEvents = False
- .Cells(lRow, 5) = .Cells(Target.Row, 1) ' ¤é´Á
- .Cells(lRow, 6) = .Cells(Target.Row, 2) ' «È¤á®Æ¸¹
- .Cells(lRow, 7) = rStuff.Offset(, 1) ' «È¤áPO
- .Cells(lRow, 8) = rStuff.Offset(, 3) ' ¥X³f¼Æ
- vBalance = vBalance - rStuff.Offset(, 3)
- rStuff.Offset(, 3) = 0
- lRow = lRow + 1
- Application.EnableEvents = True
- Else
- Application.EnableEvents = False
- .Cells(lRow, 5) = .Cells(Target.Row, 1) ' ¤é´Á
- .Cells(lRow, 6) = .Cells(Target.Row, 2) ' «È¤á®Æ¸¹
- .Cells(lRow, 7) = rStuff.Offset(, 1) ' «È¤áPO
- .Cells(lRow, 8) = vBalance ' ¥X³f¼Æ
- rStuff.Offset(, 3) = rStuff.Offset(, 3) - vBalance
- Application.EnableEvents = True
- Exit Sub ' ©|¥¼¥X³f¼Æ¶qµ¥©ó0«h¸õ¥X
- End If
- Loop
- Set rStuff = rStuff.Offset(1) ' ²¾¨ì¤U¤@µ§¸ê®Æ
- Loop Until .Cells(Target.Row, 2) <> rStuff
- End If
- End With
- End Sub
½Æ»s¥N½X |
|