- ©«¤l
- 835
- ¥DÃD
- 6
- ºëµØ
- 0
- ¿n¤À
- 915
- ÂI¦W
- 14
- §@·~¨t²Î
- Win 10,7
- ³nÅ骩¥»
- 2019,2013,2003
- ¾\ŪÅv
- 50
- ©Ê§O
- ¨k
- µù¥U®É¶¡
- 2010-5-3
- ³Ì«áµn¿ý
- 2024-11-6
|
¥»©«³Ì«á¥Ñ luhpro ©ó 2014-9-27 12:49 ½s¿è
¦^´_ Hsieh
Dear ¤j¤j
ªþ¥ó¬O§Úקï¦nªº¡A¤£ª¾¹D¦³¨S¦³§ó²«Kªº¼¶¼g¤è¦¡¡C
...
hugh0620 µoªí©ó 2014-9-26 13:42
eeee-a.zip (20.08 KB)
22¦æ¥H¤Wªº³¡¤À§A¥i¥H¦Ò¼{¥Î§Aì¨Óªº¤è¦¡,
¬Ý°_¨Ó·|¤ñ¸û²³æ.
©³¤U§Ú¥u¬O¹Á¸ÕµÛ§â¥¦Ì³£©ñ¤J¦P¤@Ó°j°é¤º.- Private Sub CommandButton1_Click()
- Application.ScreenUpdating = False
-
- [B3].Resize(Rows.Count - 2, Columns.Count - 1).Clear
- lRow = 3
- bChk = False
- Do While Cells(lRow, 1) <> ""
- With Cells(lRow, 1)
- sStr = Trim(.Value)
- sChk = Left(sStr, 3)
- If sChk = "P/O" Then
- sPo = Mid(sStr, 9)
- .Offset(, 1) = sPo
- .Offset(, 2) = sPo
- ElseIf sChk = "COL" Then
- sCo = Mid(sStr, 6)
- .Offset(, 1) = sCo
- .Offset(, 2) = sPo
- .Offset(, 3) = sCo
- .Offset(-1, 3) = sCo
- Else
- .Offset(, 2) = sPo
- .Offset(, 3) = sCo
- iCnt = 0
- iPos = 1
- Do While iPos <= Len(sStr)
- If InStr(iPos, sStr, "(") <> 0 Then
- iPos = InStr(iPos, sStr, "(") + 1
- iCnt = iCnt + 1
- Else
- Exit Do
- End If
- Loop
- With .Offset(, 4)
- .Value = sStr
- .TextToColumns Space:=True
- End With
- .Offset(, 5 + iCnt).Resize(, 3).Cut .Offset(, 20)
- For iPos = 20 To 22
- .Offset(, iPos) = Val(.Offset(, iPos)) ' «á±pºâ·|¥Î¨ì,©Ò¥H¥ýÂà´«¦¨¼ÆÈ
- Next
- vNw1 = 0
- vNw2 = 0
- For iPos = iCnt - 1 To 0 Step -1
- With .Offset(, 5 + iPos)
- .Cut .Offset(, iPos * 2)
- With .Offset(0)
- .TextToColumns Other:=True, OtherChar:="("
- sStr = .Offset(, 1)
- With .Offset(, 1)
- .NumberFormat = "@"
- .Value = Left(sStr, Len(sStr) - 1)
- End With
- End With
- End With
- If iPos <> iCnt - 1 Then
- vNw1 = Round((.Offset(, 5 + iPos * 3) / .Offset(, 20)) * .Offset(, 21), 2)
- .Offset(, 7 + iPos * 3) = vNw1
- vNw2 = vNw2 + vNw1
- End If
- Next
- .Offset(, 4 + iCnt * 3) = .Offset(, 21) - vNw2
- End If
- End With
- lRow = lRow + 1
- Loop
- Application.ScreenUpdating = True
- End Sub
½Æ»s¥N½X |
|