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

[µo°Ý] ¦³ÃöExcel VBA°}¦C¨Ï¥Î¤è¦¡...

[µo°Ý] ¦³ÃöExcel VBA°}¦C¨Ï¥Î¤è¦¡...

¥»©«³Ì«á¥Ñ VBALearner ©ó 2016-7-31 23:53 ½s¿è

Excel VBAªº°ÝÃD
½Ð°Ý¦pªG§Ú¦³­Ó¤@ºû°}¦C
¸Ì­±¦³10­Ó¼Æ¦r¤À§O¹ïÀ³°}¦C(1~10)
°²³]§Ú¤µ¤Ñ­n±Æ§Ç°}¦C¤¤¼Æ­È¤j¨ì¤p
¨º§Ú­n¦p¦óª¾¹D±Æ¦W«e5¤j¼Æ­Èªº­ì©l¼ÐÅÒ(´N¬O­ì¥»ªº1~10±Æ§Ç³Q¥´¶Ã«á ¦p¦ó©I¥s)?
·PÁ¦^µª
  1. option explicit
  2. dim total(50) as variant

  3. for i = 1 to 50
  4. total(i) = application.worksheetfunction.sum(range(cells(i,1),cells(i,10)))
  5. next

  6. sorting....%#$?!
  7. index of top 20?!
½Æ»s¥N½X
©Î¬O¦³¨ä¥L§ó¦nªº¤è¦¡?!

ºô¸ô¤W¦³»¡©ú  http://blog.xuite.net/smile1000mile/blog/95167875-EXCEL+VBA%EF%BC%8E%E5%9C%A8%E7%A8%8B%E5%BC%8F%E7%A2%BC%E4%B8%AD%E5%88%A9%E7%94%A8%E3%80%94%E9%99%A3%E5%88%97%E3%80%95%E9%80%B2%E8%A1%8C%E8%B3%87%E6%96%99%E7%9A%84%E3%80%94%E6%8E%92%E5%BA%8F%E3%80%95

TOP

¦^´_ 2# kaiclous

¸Õ¥Î¤F¨äµ{¦¡½X¤§«á §Ú¦³´X­Ó°ÝÃD·Q¦A½Ð±Ð

²Ä¤@­Ó´N¬Oapplication.transpose¦b¸Ì­±ªº¥\¯à¬O¬Æ»ò? ¥u¬O³æ¯Â¶K¤W¦Ó¤w¶Ü? §Ú«Ü¤Ö¬Ý¨ì³o­Ó¥\¯à...
²Ä¤G­Ó¬Oapplication.evaluate¬O¬Æ»ò·N«ä? §Ú§ä¤F¤@¨Ç¤å³¹ ÁÙ¬O¤£¤Ó²M·¡¥Lªº¥\¯à ¥uª¾¹D¦n¹³¬O­ÓÆZ¦n¥Îªº»yªk..?!
²Ä¤T­Ó´N¬O­ì¥»ªº°ÝÃD¡A§ÚÁÙ¬OµLªk±oª¾¦b­ì¥»ªº¸ê®Æ§Ç¦C¸Ì¡A±Æ¦æ«e´Xªº¸ê®Æ½s¸¹¬O¨º¨Ç¡A³o¥u¬O³æ¯Â±Æ§Ç¸ê®Æ¼Æ­È¦Ó¤w¡AÁÙ½Ðk¤jÀ°¦£¦A¬Ý¥J²Ó§Úªº°ÝÃD¡AÁÂÁÂ~

TOP

¥»©«³Ì«á¥Ñ lpk187 ©ó 2016-8-2 16:47 ½s¿è

¦^´_ 3# VBALearner




1.application.transpose¬°¤u§@ªí¨ç¼Æ¡GTRANSPOSE ¨ç¼Æ·|±NÀx¦s®æ¤§««ª½½d³ò¥H¤ô¥­½d³òªº®æ¦¡¶Ç¦^¡A¸Ô¨£Excel»¡©ú¡A±`¨£¥\¯à
2.¸Ô¨£VBE»¡©ú Application.Evaluate ¤èªk

TOP

¦^´_ 3# VBALearner

¦p¦óª¾¹D±Æ¦W«e5¤j¼Æ­Èªº­ì©l¼ÐÅÒ(´N¬O­ì¥»ªº1~10±Æ§Ç³Q¥´¶Ã«á ¦p¦ó©I¥s)?

¥i¥H
1. ¨Ï¥Î2­Ó¤@ºû°}¦C¡A¤@­Ó¬ö¿ý­ì©l¼ÐÅÒ(©Î¶¶¦ì)¡A¤@­Ó¬ö¿ý¸ê®Æ°}¦C
2. ¨Ï¥Î2ºû°}¦C¡A¤@ºû¬ö¿ý­ì©l¼ÐÅÒ(©Î¶¶¦ì)¡A¥t¤@ºû¬ö¿ý¸ê®Æ°}¦C
3. ©Î­ì©l¸ê®Æ»P­ì©l¼ÐÅÒ¦X¨Ö¡A
¨Ò¦p  
1  33 ¦X¨Ö¬° 33001
2  11 ¦X¨Ö¬° 11002
3  44 ¦X¨Ö¬° 44003
±Æ§Ç«á¨ú¸ê®Æ«á3½X´N¬O­ì©l¼ÐÅÒ(©Î¶¶¦ì)
{...} ªí¥Ü»Ý­n¥Î CTRL+SHIFT+ENTER ¤TÁä¿é¤J¤½¦¡

TOP

EXCEL¥»¨­ªº±Æ§Ç¥\¯à³Ì¦n¥Î, ¤]¾A¦X¤j³¡¥÷ªº¸ê®Æ«¬ºA(¤×¨ä¬O¦hÄæ¦ìªº¸ê®Æ),
¬°¦ó¤£¥Î¥¦???

TOP

¥»©«³Ì«á¥Ñ VBALearner ©ó 2016-8-3 00:18 ½s¿è

¦^´_ 5# ML089

³á³á·PÁ±z!!
§â½s½X¥[¦b«á­±ªº¤èªk¯u¬O¤ÓÁo©ú¤F!!!

TOP

¥»©«³Ì«á¥Ñ VBALearner ©ó 2016-8-3 00:19 ½s¿è

¦^´_ 6# ­ã´£³¡ªL

§Ú·|¥Îsorting¥\¯à ¦ý¬O§Úªº¸ê®Æ¦³¼ÐÅÒ¸¹½X §Ú­n±Æ§Ç§¹«áÁÙ¯àŪ¨ú¬Û¹ïÀ³ªº¼ÐÅÒ¸¹½X
¦Ó¥B§Ú¦P®É³B²z¦hºØ¸ê®Æ
©Ò¥H¤£·Q¶K¨ìworksheet¤W­±³B²z
µM«á­è¼Ó¤W´£¨ìªº¤èªk§Ú¤§«e¤]¨S·Q¹LxD
¥Øªº¬O­n§ä¦hºØ¸ê®Æ±Æ¦W«e100¤jªº¸ê®Æ¥æ¶°ªº¼ÐÅÒ¸¹½X

¥t¥~¡A§Ú¥i¥H°Ý±zapplication.transposeªº°ÝÃD¶Ü? ¥L¦n¹³¥u¬O³æ¯Â¶K¤Wªº¥\¯à?!!
ÁÙ¦³application.evaluate¡A³o¦n¹³¦³«Ü¦h¥\¯à....? ¨ä¤¤¤@ºØ¦n¹³¬O¥i¥H§â¦r¦êÅܼƭÈ? ÁÙ¦³¨ä¥L...? ¤£¤ÓÀ´
Áٽнç±Ð!

TOP

application.transpose
¬°¡eÂà¸m¡f¤§¥Î¡A­ì³]array°}¦C¬°¡e¾î¦¡¡f¡A¶·Âà¸m¤@¦¸¤~¯à¥H¡eª½¦¡-¥Ñ¤W¦Ó¤U¡f¶K¤JÄæ¦ì

application.evaluate
¥Î¨Ó±N¡e¤å¦r¦r¦ê¡fªº¡e­pºâ¦¡¡f¡A¥H¤u§@ªí¨ç¼Æ¤è¦¡ª½±µ­pºâ¥X¨äµ²ªG¡A
¨Ò¦p¡GMsgBox Application.Evaluate("=A1>A2")
¦]½d¨ÒÃD¤¤§t¡e¤å¦r¡fªº¤ñ¸û¤j¤p¡AVBA»P¤½¦¡ªº¤ñ¸ûµ²ªG¬O¤£¤@¼Ëªº¡A
¬°¤F¹F¨ìVBA±Æ§Çªºµ²ªG¯à»P¤u§@ªí±Æ§Çµ²ªG¤@­P¡A©Ò¥H§Q¥Î¤FEvaluate¡A
­Y¬O¡e¯Â¼Æ­È¡fªº¤ñ¸û¡Aª½±µ¨Ï¥Î a>B §Y¥i¡C

TOP

¦^´_ 9# ­ã´£³¡ªL

³á³á§¹¥þÀ´¤F! ·PÁ±z¥J²Ó¦a¦^µª!!!
­ì¨ÓarrayÁÙ¦³¾î¦¡¸òª½¦¡ªº°Ï§O...§Ú¥H¬°´N¥u¬O¦s¦b°O¾ÐÅé¸Ì­±ªº¸ê®Æ¦Ó¤w¡A§Ú·R¥Î¬Æ»ò§Îª¬¶K¤W´N¥Î¤°»ò§Îª¬¶K¤W......®¦~Á`¤§·PÁÂ!

TOP

        ÀR«ä¦Û¦b : ¸Ü¦h¤£¦p¸Ü¤Ö¡A¸Ü¤Ö¤£¦p¸Ü¦n¡C
ªð¦^¦Cªí ¤W¤@¥DÃD