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

[µo°Ý] EXCEL VBA¨D¤@¤¸¤G¦¸¤èµ{¦¡ (¤£¥Î¤½¦¡¸Ñ)(3)

[µo°Ý] EXCEL VBA¨D¤@¤¸¤G¦¸¤èµ{¦¡ (¤£¥Î¤½¦¡¸Ñ)(3)

­º¥ý·PÁÂAndy2483¤ÎML089 ¼ö¨Ç¸Ñµª ¦]¬°§ÚªºEXCEL VBA¨D¤@¤¸¤G¦¸¤èµ{¦¡ (¤£¥Î¤½¦¡¸Ñ)(2)³Q²¾¥h EXCELµ{¦¡°Ï ¤p¾Ç¥Í¨S¦³¿ìªk¦b¨ºµªÂШâ¦ì«e½ú
¹ï©óAndy2483«e½ú ÁÙ¦³¤@¨Ç°ÝÃD·Q½Ð±Ð
1.888¸ò999 ¬O¦Û¤v©w¸qªº¦ì¸m¶Ü¡A¬O«üÀH¾÷ªº¦ì¸m³£¥i¥H¶Ü
2.  P = Y0 * Y1
   '¡õ¹B¥Î¤G¦¸¨ç¼Æ¦bY­È=0«eªº­t¼Æ»PY­È=0«áªº¥¿¼Æ­¼¿n¬O­t¼Æ
    If P < 0 Then
   ³o¸Ì¬°¤°»ò­n°²³]¨â­Ó¤èµ{¦¡¬Û­¼¡A¨ÃÅý¤èµ{¦¡¨â­Ó¸Ñ¬Û­¼ªºP<0 ¡A¹B¥Î¤G¦¸¨ç¼Æ¦bY­È=0«eªº­t¼Æ»PY­È=0«áªº¥¿¼Æ­¼¿n¬O­t¼Æ¡A³o­ÓÁÙ¬O¦³ÂI¤£¤ÓÀ´


¹ï©óML089«e½ú¡A¤]¦³¤@¨Ç°ÝÃD½Ð±Ð
1.¬O§_¥i¥H¤£³]©w¦¹¶µ¡A Sheets.Add.Name = Format(Now(), "dd_hhmmss")¡A§Ú¥´³o¶µ¶i¥hEXCEL VBA ·|¸õ¥X¤@­Ó·sªº¤u§@ªí
2.Array¬O°}¦C¡AResize(, 3)¬O¤°»ò·N«ä
3.¬°¬Æ»ò­nWhile x <= x2  (X¬°¤°»ò<=X2
4.  Cells(r, c1).Resize(, 3) = Array(x, x + s, f(x)) 'Debug ¥Î¡A¦pªG¤£³]©w¦¹¶µ¡A¦n¹³¤]¥i¥H¹B¦æ¡A³]©w¦¹¶µªº¥Øªº¬O¬Æ»ò
5.¦pªG­n³]©w¶}©lªº®É­Ô¤å¦r¥X²{¦b¤u§@ªí¤W¡A«ö°±¤îªº®É­Ô¤å¦r´N®ø¥¢¡A­n¦p¦ó§ïµ{¦¡½X¡A¦]¬°§Ú±a¤J«e½úªºµ{¦¡½X
¡A¦n¹³¦A¤@¦¸°õ¦æ¡A¤å¦r³£·|¤@ª½¦b¤u§@ªí¤W¡A¤£·|®ø¥¢

¦^´_ 1# ´Ë³¥
¦³¤@¨Ç°ÝÃD½Ð±Ð
1.¬O§_¥i¥H¤£³]©w¦¹¶µ¡A Sheets.Add.Name = Format(Now(), "dd_hhmmss")¡A§Ú¥´³o¶µ¶i¥hEXCEL VBA ·|¸õ¥X¤@­Ó·sªº¤u§@ªí
¦^ÂСG¥i¤£¥Î¦¹¦æ¡A³o¬O´ú¸Õ¥Î¡A¨C¦¸¼W¥[·s¤u§@ªí¡A¥H§Q©M¤W¦¸°õ¦æ¤ñ¸û¡A§Ú«á­±¦³¤@­Ó§R°£Á{®É¤u§@ªíªºµ{¦¡¥i¥H¨Ï¥Î

2.Array¬O°}¦C¡AResize(, 3)¬O¤°»ò·N«ä
¦^ÂСG¤ô¥­¤è¦V¼W¥[3®æ°}¦CªÅ¶¡

3.¬°¬Æ»ò­nWhile x <= x2  (X¬°¤°»ò<=X2
³o¬O³]©w¥Ñ X1 ¤@ª½¶]¨ì X2¡A­Y§A¤w¸gª¾¹D°Ï¶¡¡A¥i¥H³]¤p¤@ÂI

4.  Cells(r, c1).Resize(, 3) = Array(x, x + s, f(x)) 'Debug ¥Î¡A¦pªG¤£³]©w¦¹¶µ¡A¦n¹³¤]¥i¥H¹B¦æ¡A³]©w¦¹¶µªº¥Øªº¬O¬Æ»ò
¦¹¦æ´N DEBUG¥Î¡AÅã¥Ü¥X¦b¤u§@ªí¤W¡A¤ñ¸û¦nDEBUGµ{¦¡³]©w

5.¦pªG­n³]©w¶}©lªº®É­Ô¤å¦r¥X²{¦b¤u§@ªí¤W¡A«ö°±¤îªº®É­Ô¤å¦r´N®ø¥¢¡A­n¦p¦ó§ïµ{¦¡½X¡A¦]¬°§Ú±a¤J«e½úªºµ{¦¡½X
¡A¦n¹³¦A¤@¦¸°õ¦æ¡A¤å¦r³£·|¤@ª½¦b¤u§@ªí¤W¡A¤£·|®ø¥¢
¦^ÂСG³o´N¤ñ¸ûÃø¦^µª

§Ú¨ºµ{¦¡«Ü¤£Ã­©w¡A­n¬Ý¤èµ{¦¡«¬ºA½Õ¾ã¤@¨Ç°Ñ¼Æ(¤À³Î¤j¤p¡B°_©l­È¡A°Ï¶¡)¡A
³o¥u¬O¦nª±¸Õ·Q¬Ý¬Ý¹q¸£¬O§_¥i¥H¥Î ¤@¬q¤@¬q¤À³Î¤è¦¡§¹¦¨¸Ñµª¡C
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

¦^´_ 2# ML089
·PÁ«e½ú¦^µª  
¨ü¯q¨}¦h

TOP

        ÀR«ä¦Û¦b : ½_ÁJµ²±o¶V¹¡º¡¡A¶V·|©¹¤U««¡A¤@­Ó¤H¶V¦³¦¨´N¡A´N­n¶V¦³Á¾¨Rªº¯ÝÃÌ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD