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

°Æµ{¦¡/if§PÂ_¤£¨ì/½Ð¨D¸Ñ´b

°Æµ{¦¡/if§PÂ_¤£¨ì/½Ð¨D¸Ñ´b

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-10-20 16:52 ½s¿è

³o¬O§Úªº¸ê®ÆÀÉ
http://cht.tw/h/nmaeu
·í§Ú¶]µ{¦¡®É¡A¤£ºÞ§Ú¿é¤J¤°»ò­È¡Aµ{¦¡¥Ã»·¶]for a=2 to 486
¨Ã¤£·|¶]§Ú³]©wªºif±ø¥ó¡A§Ú¦³¸ÕµÛ¥Îwhile¶]¦ý·|·í¾÷(¥i¯à¤£¯à³o¼Ë§a)
¤£ª¾¹D­þ¸Ì¥X¿ù¤F¡A§ï¤F«Ü¤[ÁÙ¬O§ï¤£¥X¨Ó¡C
³Â·Ð¤j®v­ÌÀ°ªì¾ÇªÌ§Ú¤p§Ì¸Ñµª¡A·P¿E¤£¶i

°ÝÃD.JPG (33.84 KB)

°ÝÃD.JPG

¦^´_ 1# ³Ì°ª¾÷±K
«Ü·Ð¤Hªº¶³ºÝ¤U¸ü¶·ÂI¼s§i,¦ý¤@ª½ÂI¼s§i,´N¬O¤£¥i¤U¸ü,°Q½×°Ï¸Ì¥i±NÀÉ®×¥ÎÀ£ÁYÀɤW¶Ç
°Æµ{¦¡¤¤§ä¤£¨ìX,YªºÅܼÆ,¶·©ó¥Dµ{¦¡¦¡ªº¼Ò²Õ¤¤ªº³»ºÝ PUBLIC X,Y ³]¬°¤½¥ÎÅܼÆ
  1. IF ¥Dµ{¦¡¼Ò²Õ.X > CELLS(A,1) OR CELLS(A,1)<=¥Dµ{¦¡¼Ò²Õ.Y
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

ÁÂÁ§Aªº«üÂI
§Ú¥[¤F§A¨º¬q«á¡A¥L»¡­n³]©wª«¥ó?¬O­n¦A¥[­þ¨Çµ{¦¡½X¶Ü?

±MÃD½d¥»0917 (§ï).rar (41.46 KB)

TOP

¦^´_ 3# ³Ì°ª¾÷±K
  1. Public X, Y

  2. Sub trend()
  3.     X = InputBox("¿é¤J²Ä¤@¤Ñ")
  4.     Y = InputBox("¿é¤J³Ì«á¤@¤Ñ")
  5.     For a = 2 To 486
  6.         If X > Cells(a, 1) And Cells(a, 1) <= Y Then
  7.             Call aa(a)
  8.         End If
  9.     Next a
  10. End Sub
½Æ»s¥N½X

TOP

¦^´_ 4# c_c_lai

·PÁ§Aªº¨ó§U
§Ú¸Õ¹L¤F¡AÁÙ¬O¤@¼Ë¶]¥X¥þ³¡:'(
¥L¨S¦³§PÂ_¨ì@@

TOP

¥»©«³Ì«á¥Ñ luhpro ©ó 2013-10-20 21:18 ½s¿è

¦^´_ 5# ³Ì°ª¾÷±K
§A»~·|¤F.

2# ©Ò»¡ ¶·©ó¥Dµ{¦¡¦¡ªº¼Ò²Õ¤¤ªº³»ºÝ PUBLIC X,Y ³]¬°¤½¥ÎÅÜ¼Æ ·N«ä¬OÅܼƭn¦b Model ¤¤¥H Public ¨Ó©w¸q:
¥H¤Uµ{¦¡©ñ¦b Model ¼Ò²Õ¤¤ :
  1. Public x, y
½Æ»s¥N½X
¥t§Aªº If x > Cells(a, 1) <= y Then «h­n§ï¬°

If x > Cells(a, 1) And Cells(a, 1) <= y Then

©³¤U¥H§A 1# ªºµ{¦¡¬°¨Ò­×§ï :
  1. Sub trend()
  2.   x = InputBox("¿é¤J²Ä¤@¤Ñ")
  3.   y = InputBox("¿é¤J³Ì«á¤@¤Ñ")
  4.   For a = 2 To 486
  5.     Call aa(a)
  6.   Next a
  7. End Sub

  8. Sub aa(ByVal a As Integer)
  9.   For b = 9 To 32
  10.     If x > Cells(a, 1) And Cells(a, 1) <= y Then
  11.       Cells(a, b + 25) = Cells(a + 2, 2) - Cells(a + 1, 2)
  12.     Else
  13.       Cells(a, b + 25) = Cells(a + 1, 2) - Cells(a + 2, 2)
  14.     End If
  15.     c = Cells(a, b + 25)
  16.     d = d + c
  17.     Cells(489, b + 25) = d
  18.     e = Cells(1, b + 25)
  19.     Cells(488, b + 25) = e
  20.   Next
  21.   c = 0
  22.   Cells(1, b + 25) = Cells(1, b)
  23. End Sub
½Æ»s¥N½X
±MÃD½d¥»0917 (§ï)-a.zip (45.87 KB)

TOP

¦^´_ 6# luhpro


    OK §Ú¹Á¸Õ¬Ý¬Ý ÁÂÁ§A

TOP

¦^´_ 6# luhpro

§Ú¹Á¸Õ¤F¤@¤U¡A§Ú­ÈÀH«K¿é¤J¡A¤@¼Ë·|´ú¸Õ¥þ³¡ ¦ü¥G¨S¦³§PÂ_¨ìIF
   
Public x, y
Sub trend()
  x = InputBox("¿é¤J²Ä¤@¤Ñ")
  y = InputBox("¿é¤J³Ì«á¤@¤Ñ")
  For a = 2 To 486
    Call aa(a)
  Next a
End Sub

Sub aa(ByVal a As Integer)
  For b = 9 To 32
    If x > Cells(a, 1) And Cells(a, 1) <= y Then
      If Cells(a, b) >= Cells(a - 1, b) Then
      Cells(a, b + 25) = Cells(a + 2, 2) - Cells(a + 1, 2)
      Else
      Cells(a, b + 25) = Cells(a + 1, 2) - Cells(a + 2, 2)
      End If
    End If
    c = Cells(a, b + 25)
    D = D + c
    Cells(489, b + 25) = D
    e = Cells(1, b + 25)
    Cells(488, b + 25) = e
  Next
  c = 0
  Cells(1, b + 25) = Cells(1, b)
End Sub

ªÑ²¼»PÃöÁä¦r 1021.rar (41.54 KB)

§A¦n³á

TOP

¦^´_  luhpro

§Ú¹Á¸Õ¤F¤@¤U¡A§Ú­ÈÀH«K¿é¤J¡A¤@¼Ë·|´ú¸Õ¥þ³¡ ¦ü¥G¨S¦³§PÂ_¨ìIF
   
Public x, y
Sub ...
³Ì°ª¾÷±K µoªí©ó 2013-10-21 01:38

²×©ó¤F¸Ñ§A«üªº°ÝÃD¦b­þ¸Ì¡A¦r¦ê¤ñ¸û³Ì¦n¨Ï¥Î StrComp() ²[¥Ü¸û©y¡C
§Ú±N If ªº§PÂ_²¾¦Ü¤J¤f³B¡A¤£µM¨C¤@¦¸°j°é³£­nµLºÝºt½m 24 ¦¸ (For b = 9 To 32)¡A
½Ð¥þ³¡¶K¦Ü Module1 ©Î ­ì¥»¤§ªí³æ¤º (¥i¥H±N Module1 ¤ºªº Public x,y ²¾°£)
µ{¦¡¬q§Ú³£¤w±N¥¦¹ï¦ì¦n¤F¡A¥H¤è«K°»¿ù»P¾\Äý¡C
  1. Public x, y

  2. Sub trend()
  3.     x = InputBox("¿é¤J²Ä¤@¤Ñ")
  4.     y = InputBox("¿é¤J³Ì«á¤@¤Ñ")
  5.     If x = "" Or y = "" Then Exit Sub
  6.    
  7.     For a = 2 To 486
  8.         Call aa(a)
  9.     Next a
  10. End Sub

  11. Sub aa(ByVal a As Integer)
  12.     If StrComp(Cells(a, 1), x, 1) >= 0 And StrComp(y, Cells(a, 1), 1) >= 0 Then
  13.         For b = 9 To 32
  14.             If Cells(a, b) >= Cells(a - 1, b) Then
  15.                 Cells(a, b + 25) = Cells(a + 2, 2) - Cells(a + 1, 2)
  16.             Else
  17.                 Cells(a, b + 25) = Cells(a + 1, 2) - Cells(a + 2, 2)
  18.             End If
  19.             c = Cells(a, b + 25)
  20.             D = D + c
  21.             Cells(489, b + 25) = D
  22.             e = Cells(1, b + 25)
  23.             Cells(488, b + 25) = e
  24.         Next
  25.         c = 0
  26.         Cells(1, b + 25) = Cells(1, b)
  27.     End If
  28. End Sub
½Æ»s¥N½X

TOP

¦^´_ 9# c_c_lai
¤Ó·PÁ§A¤F:victory: ¦¨¥\¤F~
§A¦n³á

TOP

        ÀR«ä¦Û¦b : ÁÀ¨¥¹³¤@¦·²±¶}ªºÂAªá¡A¥~ªí¬üÄR¡A¥Í©Rµu¼È¡C
ªð¦^¦Cªí ¤W¤@¥DÃD