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

[¤w¸Ñ¨M]¤èµ{¦¡¨D¸Ñ

[¤w¸Ñ¨M]¤èµ{¦¡¨D¸Ñ

¥»©«³Ì«á¥Ñ jiuhtsair ©ó 2011-10-19 20:37 ½s¿è

¦U¦ì¤j¤j¦n¡G ¤èµ{¦¡¨D¸Ñ.zip (3.26 KB)
         ¤p§Ì·Q§Q¥Î½aÁ|ªk¨Ó¨D¸Ñ3¤é¥­§¡½u¦b¦ó®É¥i¥H¬ï¯}21¤é¥­§¡½u¡C
        ¤µ¤é¦¬½L»ù¬°7358¡A©ú¤éªº3ma=sum(B6:B71)/3¡A©ú¤é21ma=sum(B51:B71)/21¡C
       ¨ä¤¤¡AB71¬°©ú¤é¦¬½L»ù¡C
       ·Q§Q¥ÎEXCEL VBA­pºâ©ú¤é¦¬½L¤U¶^¦h¤Ö®É¡A3maªº­È·|¤p©ó©Îµ¥©ó21ma?
    ·PÁ¡I
¡C
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

¥»©«³Ì«á¥Ñ diabo ©ó 2011-10-16 20:12 ½s¿è

¦^´_ 1# jiuhtsair

¤@¯ë§¡½u¤W¤É©Î¤U¶^¬O±Ä¥Î¦©©èÆ[©À±À¦ô¡A§Aªº»Ý¨D¥Î¡i¥Ø¼Ð·j´M¡j´N¥i¥H¸Ñ¨M...B71 ªºªì©l­È7000¬OÀH«Kµ¹ªº....

    ¤èµ{¦¡¨D¸Ñ.gif
diabo

TOP

¥»©«³Ì«á¥Ñ jiuhtsair ©ó 2011-10-16 23:26 ½s¿è

·PÁÂdiabo¤j¤j¡I¤£ª¾¹D¥i§_§Q¥ÎVBAµ{¦¡ªº¤è¦¡¡A³o¼Ë¥i¥H¸`¬Ù³\¦h°O¾ÐÅéªÅ¶¡...¦]¬°..³o¬O¤p§Ì·Q«Øºcªº³¡¥÷µ{¦¡¡I¦A¦¸·PÁ¡I
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¥»©«³Ì«á¥Ñ hugh0620 ©ó 2011-10-19 15:52 ½s¿è

¦^´_ 3# jiuhtsair


        ¼Ó¥D~ §AªºÁ|¨Ò¦³¨Ç°ÝÃD
        ¤p§Ì·Q§Q¥Î½aÁ|ªk¨Ó¨D¸Ñ3¤é¥­§¡½u¦b¦ó®É¥i¥H¬ï¯}21¤é¥­§¡½u¡C
        ¤µ¤é¦¬½L»ù¬°7358¡A©ú¤éªº3ma=sum(B6:B71)/3¡A©ú¤é21ma=sum(B51:B71)/21¡C
        3¤é§¡½uªººâªk¦³°ÝÃD,À³¸Ó¬O3ma=sum(B69:B71)/3        
        ¨ä¤¤¡AB71¬°©ú¤é¦¬½L»ù¡C
        ·Q§Q¥ÎEXCEL VBA­pºâ©ú¤é¦¬½L¤U¶^¦h¤Ö®É¡A3maªº­È·|¤p©ó©Îµ¥©ó21ma?

       ¶È¹ï©ó¤U¶^¦h¤Öªº¤è¦¡¨Ó¼¶¼g~ §Æ±æ¹ï§A¦³À°§U
  1. Sub ªÑ»ù±À¦ô()
  2. A = Sheet1.Range("B65536").End(xlUp).Row '¥ý¨ú±o³Ì«á¤@µ§ªº¦C¼Æ¡A©¹¦^±À

  3. B1 = Application.Sum(Sheet1.Range(Cells(A + 1, 2), Cells(A - 19, 2))) '­pºâ21¤ÑÁ`ªÑ»ù
  4. B2 = Application.Sum(Sheet1.Range(Cells(A + 1, 2), Cells(A - 1, 2)))  '­pºâ3¤ÑÁ`ªÑ»ù

  5. A1 = B1 / 21  ''A1=21¤Ñ§¡½u
  6. Sheet1.Range("D65536").End(xlUp).Offset(1, 0) = A1

  7. A2 = B2 / 3   ''A2=3¤Ñ§¡½u
  8. Sheet1.Range("C65536").End(xlUp).Offset(1, 0) = A2

  9. I = Int(B2 / 2)  '±Ä¥Î«e­±¨â¤éªº¥­§¡»ù¬°°ò·Ç¡A±À´ú¤U¶^¦h¤Ö·|³e¬ï21¤é§¡½u

  10. Do
  11.     A1 = (B1 + I) / 21
  12.     A2 = (B2 + I) / 3
  13.        Sheet1.Cells(A + 1, 2) = I
  14.     Sheet1.Range("D65536").End(xlUp).Offset = A1
  15.     Sheet1.Range("C65536").End(xlUp).Offset = A2
  16.     I = I - 0.1                    ' <---­×¥¿ªÑ»ùªººë·Ç«×

  17. Loop Until A1 > A2        'A2(3¤Ñ§¡½u)¤p©óA1(21¤Ñ§¡½u)´N°±¤î


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

TOP

¦^´_ 4# hugh0620

·PÁ¤j¤jªº±Ð¾É¡I¤]¦V¤j¤j»¡©êºp¡A¦Û¤v¦bKEY¸ê®Æ®É¥´¿ù¤F¡A²Ó¤ßªº¤j¤j¬Ý¤F¥X¨Ó¡I

·PÁ¦A·PÁ¡I
50 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD