ªð¦^¦Cªí ¤W¤@¥DÃD µo©«

[µo°Ý] °j°é°ÝÃD

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2012-3-26 09:25 ½s¿è

¦^´_ 7# spermbank

«Ü©êºp­ò~ µ{¦¡½X¥´¿ù¤@­Ó¦r  ±N²Ä28¦Cb§ï¦¨K ´N¥i¥H¤F
ABuyP = b * 1000 * 0.001425 * 0.28
ABuyP = K * 1000 * 0.001425 * 0.28
  1. Sub nn()

  2. '=========================='½Õ¾ãC°ÏªÑ»ù³W«h
  3. For Each A In Range("A:A").SpecialCells(xlCellTypeConstants, xlNumbers)
  4. B = Application.Lookup(A, Array(0, 11, 51, 101, 501, 1001), Array(0.01, 0.05, 0.1, 0.5, 1, 5))
  5. A.Offset(, 2) = Application.Ceiling(A, B)
  6. Next
  7. '=========================='Àò§Q1%ªÑ§Q­pºâ¡A¤£¥]§t¤âÄò¶O¡BÃÒ¥æµ|
  8. Sheets("Sheet1").Select
  9. x = Application.WorksheetFunction.CountA(Range("A:A")) 'Äæ¦ì¦³­È½d³ò­pºâ
  10. For i = 2 To x
  11.     Cells(i, "G") = Cells(i, "C") * Cells(9, "O") + Cells(i, "C")
  12. Next
  13. '=========================='½Õ¾ãÀò§QªÑ»ù³W«h
  14. For Each A In Range("G:G").SpecialCells(xlCellTypeConstants, xlNumbers)
  15. B = Application.Lookup(A, Array(0, 11, 51, 101, 501, 1001), Array(0.01, 0.05, 0.1, 0.5, 1, 5))
  16. A.Offset(, 0) = Application.Ceiling(A, B)
  17. Next
  18. '=========================='­pºâÀò§Q1%¦©°£¤âÄò¶O»PÃÒ¥æµ|ª÷ÃB
  19. Sheets("Sheet1").Select
  20. x = Application.WorksheetFunction.CountA(Range("A:A")) 'Äæ¦ì¦³­È½d³ò­pºâ

  21. For i = 2 To x
  22.         K = Cells(i, "C")    '¶R¶iªÑ»ù¡A¬O¤@­Ó©T©w­Èªº±ø¥ó¤U¡A±Àºâì§Q±µ±µªñ1%®ÉªºªÑ»ù¤ÎÀò§Q
  23.         If K * 1000 * 0.001425 * 0.28 <= 20 Then '¶R¶i¤âÄò¶O¬O¤@­Ó¤wµo¥Íªº±ø¥ó¡A­Y§C©ó20¶ê¡A«h¬°20¶ê¡A
  24.             ABuyP = 20
  25.         Else
  26.             ABuyP = K * 1000 * 0.001425 * 0.28
  27.         End If
  28.         ABuy = K * 1000 + ABuyP
  29.         B1 = Application.Lookup(K, Array(0, 11, 51, 101, 501, 1001), Array(0.01, 0.05, 0.1, 0.5, 1, 5)) 'ªÑ»ù¼W¥[¤ñ²v
  30.         J = 0
  31.         Do
  32.         B2 = B1 * J
  33.         If (K + B2) * 1000 * 0.001425 * 0.28 <= 20 Then '½æ¥X¤âÄò¶O­Y§C©ó20¶ê¡A«h¬°20¶ê
  34.             ABuyP1 = 20
  35.         Else
  36.             ABuyP1 = (K + B2) * 1000 * 0.001425 * 0.28
  37.         End If
  38.         ASell = (K + B2) * 1000 - (K + B2) * 1000 * 0.003 - ABuyP1
  39.         A = (ASell - ABuy) / ABuy
  40.         J = J + 1
  41.         Loop While A <= 0.01     '³f§Q¦b>=0.01®É¡A°±¤î¹Bºâ
  42.         Cells(i, "K") = K + B2 - B1 '­pºâÀò§Q¦©°£¤âÄò¶O»PÃÒ¥æµ|ªºÀò§Q%¼Æ
  43.         Cells(i, "L") = (((K + B2 - B1) * 1000 - (K + B2 - B1) * 1000 * 0.003 - ABuyP1) - ABuy) / ABuy
  44.         Cells(i, "M") = (((K + B2 - B1) * 1000 - (K + B2 - B1) * 1000 * 0.003 - ABuyP1) - ABuy) '­pºâÀò§Q¦©°£¤âÄò¶O»PÃÒ¥æµ|ªºÀò§Qª÷ÃB
  45. Next


  46. End Sub
½Æ»s¥N½X
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

¦^´_ 10# GBKEE


    ÁÂÁÂG¤j

TOP

¦^´_ 11# hugh0620


    ÁÂÁÂH¤j

TOP

¦^´_ 10# GBKEE


    G¤j¤j~ ¥ÎVBA¨Ó±a¥X¨ç¼Æ¥ç¬O«Ü¦nªº¤@©Û~
    ¥u­n±N¤½¦¡¦C¥Xª½±µ®M¥Î~
    ¦A¥h±À¾É¥X·sªÑ»ùªº»ù®æ~
    ÆZ­È±o¾Ç²ßªº~
¾Ç²ß¤~¯à´£¤É¦Û¤v

TOP

        ÀR«ä¦Û¦b : ¦h°µ¦h±o¡C¤Ö°µ¦h¥¢¡C
ªð¦^¦Cªí ¤W¤@¥DÃD