¿¿Æ×µç×ÓÊé > ¾­¹ÜÆäËûµç×ÓÊé > excel_vba_±à³Ì½Ì³Ì(ÍêÕû°æ) >

µÚ21²¿·Ö

excel_vba_±à³Ì½Ì³Ì(ÍêÕû°æ)-µÚ21²¿·Ö

С˵£º excel_vba_±à³Ì½Ì³Ì(ÍêÕû°æ) ×ÖÊý£º ÿҳ4000×Ö

°´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·­Ò³£¬°´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ£¬°´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿£¡
¡ª¡ª¡ª¡ªÎ´ÔĶÁÍꣿ¼ÓÈëÊéÇ©ÒѱãÏ´μÌÐøÔĶÁ£¡



ÏÔʾ¹¤×÷±íÖÐÓÐÄÚÈݵÄÇøÓò¡£ÕâÁ½ÖÖÑ¡ÏÓÐÏàÓ¦µÄÄÚÖó£ÊýÀ´±íʾ¡£Excel³£ÊýÆðÃû×ÜÊÇÒÔ¡°xl¡±¡¡
¿ªÍ·¡£ÄãÒ»µ©ÔÚ´úÂë´°¿ÚÀïÊäÈëÖ¸Á¡¡¡¡
ActiveWindow¡£View¡¡=¡¡¡¡
¾Í»áµ¯³öÒ»¸ö²Ëµ¥£¬ÁгöÕâ¸öÊôÐÔµÄÓÐЧ³£ÊýÃû³Æ¡£Ê¹ÓÃÔÚÉϽÚÖС°ÊôÐÔ/·½·¨ÁÐ±í¡±µ¯³ö²Ëµ¥Í¬¡¡
ÑùµÄ¼¼Êõ£¬Ò²¿ÉÒÔ´¦Àí¡°³£ÊýÁÐ±í¡±µ¯³ö²Ëµ¥¡£°´ÏÂCtrl£«Shift£«J»òÕßµã»÷¡°±à¼­Æ÷¡±¹¤¾ßÌõÉϵġ¡
¡¡¡°³£ÊýÁÐ±í¡±°´Å¥£¬¿ÉÒÔ¼¤»î³£ÊýÁбí²Ëµ¥¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡51¡¡

¡­¡¡Ò³Ãæ¡¡68¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­13¡¡³£ÊýÁÐ±íµ¯³ö²Ëµ¥ÏÔʾÁ˶ÔÇÃÈëµÄÊôÐÔÓÐЧµÄ³£ÊýÇåµ¥¡¡¡¡

14¡¡²ÎÊýÐÅÏ¢¡¡¡¡

Èç¹ûÄãÓйýʹÓÃExcelº¯ÊýµÄ¾­Àú£¬Äã¾Í»áÖªµÀÐí¶àº¯ÊýÐèÒªÒ»¸ö»òÕ߶à¸ö×Ô±äÁ¿£¨»òÕß²ÎÊý£©¡£Èç¡¡
¹ûVBº¯ÊýÒªÇó×Ô±äÁ¿£¬Äã¿ÉÒÔÔÚÊäÈë×óÀ¨ºÅºóÔÚ¹â±êÏÂÃæ¿´µ½Ò»¸öÌáʾ¿ò£¬ÏÔʾ±ØÒªµÄ»ò¿ÉÑ¡µÄ×Ô¡¡
±äÁ¿µÄÃû³Æ£¨²Î¼ûͼ2£­14£©¡£²ÎÊýÐÅÏ¢°ïÄãºÜÈÝÒ׵ظøVBAº¯ÊýÉèÖòÎÊý¡£ÁíÍ⣬ËüÌáÐÑÄãÆäËüÁ½¡¡
¼þ¶Ôº¯ÊýÔËÐÐÕýÈ·ÖÁ¹ØÖØÒªµÄÊÂÇ飺×Ô±äÁ¿µÄ˳ÐòºÍ×Ô±äÁ¿ÒªÇóµÄÊý¾ÝÀàÐÍ¡£Ä㽫ÔÚÏÂÒ»ÕÂÀïѧϰ¡¡
Êý¾ÝÀàÐÍ¡£¡¡¡¡
ÔÚ´úÂë´°¿ÚÀïÃæÊäÈëÏÂÊö´úÂ룬¿´¿´²ÎÊýÐÅÏ¢ÊÇÈçºÎ¹¤×÷µÄ£º¡¡¡¡
ActiveWorkbook¡£SaveAs£¨¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­14¡¡A¡¡tip¡¡window¡¡displays¡¡a¡¡list¡¡of¡¡arguments¡¡utilized¡¡by¡¡a¡¡VBA¡¡function¡¡or¡¡instruction¡£¡¡¡¡
ÄãÒ»µ©ÊäÈëÁË¿ªÊ¼µÄÀ¨ºÅ£¬¹â±êµÄÏÂÃæ¾Í»á³öÏÖÒ»¸öÌáʾ¿ò£¬µ±Ç°µÄ×Ô±äÁ¿»áÏÔʾΪ´ÖÌ壻µ±ÄãÊä¡¡
ÈëÍêµÚÒ»¸ö×Ô±äÁ¿²¢ÇÒÊäÈëÁ˶ººÅ£¬VB»á½«ÏÂÒ»¸ö×Ô±äÁ¿Îª´ÖÌå¡£¿ÉÑ¡µÄ×Ô±äÁ¿»áÓÃÖÐÀ¨ºÅ£§¡¡£§À¨¡¡
ÆðÀ´¡£Ö»Òª°´ÏÂEsc¼ü¾Í¿ÉÒԹرղÎÊýÐÅÏ¢´°¿Ú¡£ÈçºÎʹÓüüÅÌÀ´´ò¿ªÌáʾ´°¿Ú£¿ÊäÈëÖ¸Áî»òº¯Êý£¬¡¡
½ô½Ó×ÅÊÇ×óÀ¨ºÅ£¬È»ºó°´ÏÂCtrl£«Shift£«I¡£ÄãÒ²¿ÉÒÔµã»÷±à¼­²Ëµ¥ÉϵIJÎÊýÐÅÏ¢°´Å¥»òÕßÑ¡Ôñ¡°±à¡¡
¼­¡±£­¡°²ÎÊýÐÅÏ¢¡±¡£¡¡¡¡

15¡¡¿ìËÙÐÅÏ¢¡¡¡¡

µ±ÄãÑ¡ÔñÁË´úÂë´°¿ÚÀïµÄÖ¸Áº¯Êý£¬·½·¨£¬¹ý³ÌÃû³Æ»òÕß³£Êý£¬È»ºóµã»÷±à¼­¹¤¾ßÌõÉϵġ°¿ìËÙ¡¡
ÐÅÏ¢¡±°´Å¥£¨»òÕß°´ÏÂCtrl£«I£©£¬VB½«»áÏÔʾͻ³öÏÔʾÏîÄ¿µÄÓï·¨ºÍ³£ÊýµÄÖµ¡£¿ìËÙÐÅÏ¢¿ÉÒÔͨ¹ý¡¡
Ñ¡Ïî¶Ô»°¿òÀ´´ò¿ª»òÕ߹رա£Ôڱ༭Æ÷Ò³£¬¹´Ñ¡¡°×Ô¶¯ÏÔʾ¿ìËÙÐÅÏ¢¡±£¬´ò¿ª¿ìËÙÐÅÏ¢¹¦ÄÜ¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­15¡¡¿ìËÙÐÅÏ¢Ìṩº¯Êý²ÎÊýÇåµ¥£¬Ò²¿ÉÒÔÊdz£ÊýÖµºÍVBAÓï¾äÓï·¨¡¡¡¡

16¡¡×Ô¶¯Íê³É¹Ø¼ü×Ö¡¡¡¡

¼ÓËÙÔÚ´úÂë´°¿Ú±àдVBA³ÌÐòµÄÁíÒ»ÖÖ·½·¨ÊÇʹÓá°×Ô¶¯Íê³É¹Ø¼ü×Ö¡±¹¦ÄÜ¡£µ±ÄãÊäÈëÒ»¸ö¹Ø¼ü×Ö¡¡
µÄÇ°¼¸¸ö×Öĸ£¬È»ºó°´ÏÂCtrl£«¿Õ¸ñ¼ü£¬»òÕßµã»÷±à¼­¹¤¾ßÌõÉϵġ°×Ô¶¯Íê³É¹Ø¼ü×Ö¡±°´Å¥£¬VB»á¡¡
°ïÄãÊäÈëÕâ¸ö¹Ø¼ü×ÖµÄÊ£Óà×Öĸ£¬½ÚÔ¼ÄãµÄʱ¼ä¡£ÀýÈ磬ÔÚ´úÂë´°¿ÚÀïÊäÈë¹Ø¼ü×Ö¡°Application¡±¡¡
µÄÇ°Ëĸö×Öĸ£¬²¢ÇÒ°´ÏÂCtrl£«¿Õ¸ñ¼ü£º¡¡¡¡
Appl¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡52¡¡

¡­¡¡Ò³Ãæ¡¡69¡­

VB½«»áÍê³ÉÊ£ÓàµÄ×Öĸ£¬ÔÚApplµØ·½£¬Ä㽫¿´µ½Õû¸ö¹Ø¼ü×ÖApplication¡£Èç¹ûÓкü¸¸ö¹Ø¼ü×־ߡ¡
ÓÐÏàͬµÄ¿ªÍ·×Öĸ£¬µ±Äã°´ÏÂCtrl£«¿Õ¸ñ¼üºó£¬VB»áÏÔʾһ¸öµ¯³ö²Ëµ¥£¬ÁгöËùÓйؼü×Ö¡£²âÊÔÕâ¡¡
¸öÀý×Ó£¬¿ÉÒÔÊäÈë¹Ø¼ü×ÖApplicationµÄÇ°Èý¸ö×Öĸ£¬°´¹¤¾ßÌõÉϵÄ×Ô¶¯Íê³É¹Ø¼ü×Ö°´Å¥£¬È»ºóÔÚ¡¡
µ¯³ö²Ëµ¥ÉÏÑ¡È¡ºÏÊʵĹؼü×Ö¡£¡¡¡¡

17¡¡Ëõ½ø/͹³ö¡¡¡¡

Ò²ÐíÄãÒѾ­¿´µ½£¬ÔÚÑ¡Ïî¶Ô»°¿òµÄ±à¼­Æ÷Ò³ÉÏÓÐÐí¶àÉèÖÃÄã¿ÉÒÔ´ò¿ªÒÔʹÓôúÂë´°¿ÚÐí¶à¿ÉÓõÄ×Ô¡¡
¶¯¹¦ÄÜ¡£Èç¹û¹´Ñ¡ÁË¡°×Ô¶¯Ëõ½ø¡±Ñ¡ÏÄã¾Í¿ÉÒÔ×Ô¶¯Ëõ½øËùÑ¡µÄ´úÂëÐУ¬Ëõ½øµÄÁ¿Îª¡°Tab¿í¶È¡±¡¡
Îı¾¿òÀïµÄÊý×Ö¡£Ä¬ÈϵÄ×Ô¶¯Ëõ½øÁ¿ÊÇ4¸ö×Öĸ£¬ÄãÒ²¿ÉÒÔÔÚÎı¾¿òÀïÊäÈëÒ»¸öеÄÊý×ÖÀ´¸Ä±äTab¡¡
¿í¶È¡£ÄãΪʲôÐèÒªÔÚ´úÂëÀïʹÓÃËõ½ø£¿Ëõ½ø¿ÉÒÔʹÄãµÄ´úÂë¸üÈÝÒ×ÔĶÁºÍÀí½â¡£ÌرðÊÇÊäÈëһЩ¡¡
×ö¾ö¶¨»òÖظ´ÐÔ¹¤×÷µÄ´úÂëÐÐʱ£¬¸ü½¨ÒéʹÓÃËõ½ø¡£Ä㽫ÔÚµÚÎåºÍµÚÁùÕÂÖÐѧϰÈçºÎ´´½¨ÕâÖÖÀàÐÍ¡¡
µÄVBÖ¸Áî¡£ÏÖÔÚ£¬ÎÒÃÇÀ´Á·Ï°Ê¹ÓÃËõ½øºÍ͹³ö´úÂëÐУ¬ÓõÚÒ»ÕÂÀïµÄºêWhatsInACell×÷ΪÀý×Ó£º¡¡¡¡
1¡£¡¡¡¡ÔÚ¹¤³Ìä¯ÀÀÆ÷´°¿Ú£¬Ñ¡ÔñFirstSteps£¨Chap01¡£xls£©¹¤³Ì£¬²¢ÇÒ¼¤»îº¬ÓÐWhatsInACell´úÂëµÄ¡¡
¡¡¡¡¡¡¡¡WorksheetFormattingÄ£¿é¡¡¡¡
2¡£¡¡¡¡Ñ¡Ôñ¿ªÊ¼Îª¹Ø¼ü×ÖWithºÍ½áÊøΪEnd¡¡WithµÄÒ»¶Î´úÂë¡¡¡¡
3¡£¡¡¡¡µã»÷±à¼­¹¤¾ßÌõÉϵÄËõ½ø°´Å¥£¬»òÕß°´¼üÅÌÉϵÄTab¼ü£¨ÒëÕߣº°´Tab¼üÐèÒª½«¹â±ê·ÅÔÚÐÐÊ×£¬¡¡
¡¡¡¡¡¡¡¡¶ø·ÇÑ¡ÖÐÖ¸Á¡¡¡¡
4¡£¡¡¡¡Ñ¡ÖеÄÖ¸Áî»áÏòÓÒÒƶ¯4¸ö×ÖĸµÄλÖã¬Èç¹ûʹÓÃÁËTab¿í¶ÈµÄĬÈÏÉèÖᣡ¡¡¡
5¡£¡¡¡¡µã»÷±à¼­¹¤¾ßÌõÉϵġ°Í¹³ö¡±°´Å¥£¬»òÕß°´Shift£«Tab½«Ñ¡ÖеÄÖ¸ÁîÐзµ»ØÔ­À´µÄλÖᣡ¡¡¡
Ëõ½øºÍ͹³öͬÑù¿ÉÒÔÔڱ༭²Ëµ¥ÀïÕÒµ½¡£¡¡¡¡

18¡¡ÉèÖÃ×¢ÊÍ¿é/½â³ý×¢ÊÍ¿é¡¡¡¡

ÔÚµÚÒ»ÕÂÖУ¬ÄãѧϰÁËÒ»ÐдúÂëÇ°Ãæ¼ÓÒ»¸öÒýºÅ±íʾעÊÍ¡£×¢ÊͲ»µ«Ê¹´úÂë¸üÈÝÒ×Àí½â£¬¶øÇÒËüÔÚ¡¡
VBA¹ý³ÌµÄ²âÊԺʹ¦ÀíÎÊÌâÖж¼ÊǺÜÓÐÓõġ£ÀýÈ磬ÄãÖ´ÐÐÒ»¸ö¹ý³Ìʱ£¬Ëü¿ÉÄܺÍÆÚÍûµÄÔËÐв»Ò»¡¡
Ö£¬¶ÔÓÚÄÇЩ¿ÉÄܲúÉúÎÊÌâµÄ´úÂëÐУ¬ÄãÏÖÔÚÏëÂÔ¹ýËüÃÇ£¬µ«ÊÇÒÔºó¿ÉÄÜ»¹ÐèÒªÓõ½ËüÃÇ£¬Äã¾Í¿É¡¡
ÒÔÔÚËüÃÇÇ°Ãæ¼ÓÒ»¸öÒýºÅ×¢Ê͵ôËüÃÇ£¬¶ø²»±Øɾ³ýËüÃÇ¡£¶Ô´ó¶àÊýÈËÀ´Ëµ£¬ÐèҪעÊ͵ôÒ»ÐдúÂëµÄ¡¡
»°£¬Ö»ÓÐÔÚËüÇ°ÃæÇÃÈëÒ»¸öÒýºÅ¾Í¿ÉÒÔÁË£¬µ«ÊÇ£¬Èç¹ûҪעÊ͵ôÕû¿é´úÂ룬ʹÓᰱ༭¡±¹¤¾ßÌõÉÏ¡¡
µÄ¡°ÉèÖÃ×¢ÊͿ顱ºÍ¡°½â³ý×¢ÊͿ顱°´Å¥ÔòÊǺܷ½±ãµÄ¡£Òª×¢Ê͵ô¼¸ÐдúÂ룬ֻҪѡÖÐÕâЩ´úÂëÐС¡
²¢ÇÒµã»÷¡°ÉèÖÃ×¢ÊͿ顱°´Å¥¡£µã»÷¡°½â³ý×¢ÊͿ顱°´Å¥£¬½«×¢Ê͵ôµÄ´úÂë»Ö¸´µ½´úÂëÀï¡£¡¡¡¡
Èç¹ûÄãûÓÐÑ¡ÖÐÎı¾£¬¾Íµã»÷ÁË¡°ÉèÖÃ×¢ÊͿ顱°´Å¥£¬Ö»ÓÐÔÚ¹â±êËùÔڵĴúÂëÐÐÇ°Ãæ¼ÓÈëÒýºÅ¡£¡¡¡¡

19¡¡Ê¹ÓöÔÏóä¯ÀÀÆ÷¡¡¡¡

Èç¹ûÄãÏëÒªÔÚVBAÖÚ¶àµÄ×é¼þºÍ¹¦ÄÜÖÐ×ÔÓÉÇл»£¬ÄÇôʹÓöÔÏóä¯ÀÀÆ÷¡£Õâ¸öרÃŵÄÄÚÖù¤¾ßÔÚVB¡¡
±à¼­Æ÷´°¿ÚÊÇ¿ÉÓõġ£Ê¹ÓÃÏÂÃæÈκÎÒ»ÖÖ·½·¨¶¼¿ÉÒÔ·ÃÎʶÔÏóä¯ÀÀÆ÷£º¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡53¡¡

¡­¡¡Ò³Ãæ¡¡70¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­16¡¡¶ÔÏóä¯ÀÀÆ÷ÈÃÄãÔÚµ±Ç°VBA¹¤³ÌÀï¿ÉÓõÄËùÓжÔÏó£¬ÊôÐԺͷ½·¨Àïä¯ÀÀ¡¡¡¡
¶ÔÏóä¯ÀÀÆ÷ÈÃÄãä¯ÀÀVBA¹ý³ÌÖпÉÓõĶÔÏó£¬Ò²¿ÉÒԲ鿴ËüÃǵÄÊôÐÔ£¬·½·¨ºÍʼþ¡£ÔÚ¶ÔÏóä¯ÀÀÆ÷¡¡
µÄ°ïÖúÏ£¬Äã¿ÉÒÔÔÚVBA¹¤³ÌµÄ¶à¸ö¹ý³ÌÖ®¼ä¿ìËÙÒƶ¯¡£¡¡¡¡
¶ÔÏóä¯ÀÀÆ÷·ÖΪÈý²¿·Ö£¨²Î¼ûͼ2£­16£©¡£´°¿ÚµÄÉϲ¿ÏÔʾ¡°¹¤³Ì/¿â¡±ÏÂÀ­ÁÐ±í£¬ÕâÀïÁгöÁËËùÓС¡
¿âÃû³ÆÒÔ¼°µ±Ç°VBA¹¤³ÌÀï¿ÉÓõÄËùÓй¤³ÌÃû³Æ¡£¿âÊÇ°üº¬Ò»¸öÓ¦ÓóÌÐòÀï¶ÔÏóµÄÐÅÏ¢µÄרÃÅÎļþ¡£¡¡
еĿâ¿ÉÒÔͨ¹ý¡°ÒýÓᱶԻ°¿ò£¨¡°¹¤¾ß¡±£­¡°ÒýÓá±£©À´Ìí¼Ó¡£ÁгöÁËÄãµçÄÔÉÏ°²×°Á˵ġ¡
ËùÓпâÖеÄËùÓжÔÏó¡£µ±ÄãÑ¡ÔñÒ»¸ö½Ð¡°Excel¡±µÄ¿âʱ£¬½ö½öÄÜÔÚExcelÀïÖ´ÐеĶÔÏóÃû³Æ²ÅÄܱ»¡¡
¿´µ½¡£ºÍExcel¿âÏà·´£¬VBA¿âÁгöÁËËùÓÐÄÜÔÚVBAÀïÖ´ÐеĶÔÏóÃû³Æ¡£¡¡¡¡
ÔÚ¡°¹¤³Ì/¿â¡±ÏÂÀ­Áбí¿òÏÂÃ棬ÓÐÒ»¸ö¡°ËÑË÷¡±Îı¾¿ò£¬ÈÃÄã¿ÉÒÔ¿ìËÙµØÔÚij¸ö¿âÀïËÑË÷ÄãµÄÐÅ¡¡
Ï¢¡£Õâ¸öµØ·½»á¼ÇסÄã×î½üËÑË÷µÄËĸöÏîÄ¿¡£ÔÚ¶ÔÏóä¯ÀÀÆ÷µÄÈκεط½µ¥»÷ÓÒ¼ü£¬ÔÚ¿ì½Ý²Ëµ¥ÉÏÑ¡¡¡
Ôñ¡°È«×ÖÆ¥Å䡱£¬Äã¾Í¿ÉÒÔÖ»ËÑË÷Æ¥ÅäÕû¸ö×ÖµÄÄÚÈÝ¡£¶ÔÏóä¯ÀÀÆ÷Éϵġ°ËÑË÷½á¹û¡±£¨²Î¼ûͼ2£­16¡¡
ºÍ2£­17£©ÏÔʾ·ûºÏËÑË÷Ìõ¼þµÄ¿â£¬ÀàºÍ³ÉÔ±¡£µ±ÄãÊäÈëËÑË÷Îı¾²¢ÇÒµ¥»÷ËÑË÷°´Å¥£¬VBÕ¹¿ª¶ÔÏó¡¡
ä¯ÀÀÆ÷¶Ô»°¿òÒÔÏÔʾËÑË÷½á¹û¡£Äã¿ÉÒÔµã»÷¡°ÍûÔ¶¾µ¡±°´Å¥Óұߵġ°ÏÔʾ/Òþ²ØËÑË÷½á¹û¡±À´ÏÔʾ¡¡
»òÕßÒþ²ØËÑË÷½á¹û¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡54¡¡

¡­¡¡Ò³Ãæ¡¡71¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­17¡¡ÔÚ¶ÔÏóä¯ÀÀÆ÷ÀïËÑË÷´ð°¸¡¡¡¡
ÀàÁбí¿òÏÔʾËùÑ¡ÖеĿâÀïÃæËùÓпÉÓõĶÔÏóÀ࣬Èç¹ûÄãÑ¡ÔñVBA¹¤³Ì£¬ÁбíÏÔʾ¸Ã¹¤³ÌÀïµÄ¶ÔÏ󡣡¡
ÔÚͼ2£­16ÀmandBarboBox¡¡¶ÔÏóÀ౻ѡÖÐÁË¡£µ±ÄãÑ¡ÖÐÒ»¸öÀ࣬ÓұߵÄÁÐ±í£¨³ÉÔ±£©ÏÔʾ¡¡
¸ÃÀà¿ÉÓõÄÊôÐÔ£¬·½·¨ºÍʼþ¡£Í¼2£­16ÉÏÏÔʾÁËÀàmandBarboBoxµÄһЩ³ÉÔ±¡£³ÉԱĬÈϵء¡
°´×Öĸ˳ÐòÁгö¡£È»¶ø£¬Äã¿ÉÒÔʹÓöÔÏóä¯ÀÀÆ÷¿ì½Ý²Ëµ¥Éϵġ°×é³ÉÔ±¡±À´×éÖ¯ÕâЩ³ÉÔ±ÁÐ±í£¨Êô¡¡
ÐÔ£¬·½·¨»òʼþ£©¡£Èç¹ûÄãÑ¡Ôñ¡°¹¤³Ì/¿â¡±ÀïÃæµÄVBA¹¤³Ì£¬³ÉÔ±Áбí¿òÁгö¸Ã¹¤³ÌÀïµÄËùÓйý³Ì¡£¡¡
Ë«»÷¸Ã¹ý³ÌÃû³Æ£¬¾Í¿ÉÒÔ½øÈë¸Ã¹ý³Ì²¢¼ì²éÆä´úÂë¡£Èç¹ûÄãÑ¡ÔñÀà¡°VBA¡±£¬Ä㽫¿´µ½VBÄÚÖõĺ¯Êý¡¡
ºÍ³£Êý¡£Èç¹ûÄã¶ÔËùÑ¡µÄÀà»ò³ÉÔ±ÐèÒª¸ü¶àµÄÐÅÏ¢£¬¿ÉÒÔµã»÷¶ÔÏóä¯ÀÀÆ÷´°¿ÚÉÏÃæµÄÎʺŰ´Å¥¡£¶Ô¡¡
Ïóä¯ÀÀÆ÷ÏÂÃæµÄ´°¿ÚÏÔʾËùÑ¡³ÉÔ±µÄ´úÂë¸ñʽ¡£Èç¹ûÄãµã»÷´úÂë¸ñʽÀïÂÌÉ«µÄÁ¬½Ó²¿·Ö£¬Ä㽫Ìøµ½¡¡
¶ÔÏóä¯ÀÀÆ÷´°¿ÚµÄËùÑ¡³ÉÔ±µÄÀà»ò¿â¡£´úÂë¸ñʽÀïµÄ´úÂë¿ÉÒÔ±»¸´ÖƵ½Windows¼ôÇа岢ÇÒÕ³Ìùµ½¡¡
´úÂë´°¿ÚÀïÈ¥¡£Èç¹û¶ÔÏóä¯ÀÀÆ÷ºÍ´úÂë´°¿Ú¶¼ÊǿɼûµÄ£¬ÄãֻҪѡÖдúÂë¸ñʽÀïµÄÎı¾£¬Ö±½ÓÍÏÒ·¡¡
µ½´úÂë´°¿Ú¾ÍÐÐÁË¡£¡¡¡¡
ͨ¹ý¶ÔÏóä¯ÀÀÆ÷´°¿ÚÉϵĺáÊú·Ö¸îÏߣ¬Äã¿ÉÒÔÇáÒ׵ظıä¸÷¸ö´°¿ÚµÄ´óС¡£¡¡¡¡
ÄãÒѾ­·¢ÏÖÁ˶ÔÏóä¯ÀÀÆ÷£¬ÄãÒ²ÐíÔÚÏëÄãÈçºÎ²ÅÄÜÈÃËü°ïÖúÄã½øÐÐVBA±à³Ì¡£¼ÙÉèÄãÔÚ¹¤×÷±íÖÐÑë¡¡
·ÅÖÃÁËÒ»¸öÎı¾¿ò£¬ÄãÈçºÎÈÃExcel½«Õâ¸öÎı¾¿òÒƶ¯µ½¹¤×÷±íµÄ×óÉÏ·½£¿¡¡¡¡
1¡£¡¡¡¡´ò¿ªÒ»¸öй¤×÷±í¡¡¡¡
2¡£¡¡¡¡Ñ¡Ôñ¡°ÊÓͼ¡±£­¡°¹¤¾ßÀ¸¡±£¬È»ºóµã»÷¡°»æͼ¡±¡¡¡¡
3¡£¡¡¡¡µã»÷¡°»æͼ¡±ÉϵÄÎı¾¿ò£¬ÔÚ¹¤×÷±íÖÐÑë»­Ò»¸öÎı¾¿ò£¬²¢ÇÒËæ±ãÊäÈëʲôÎÄ×Ö¡¡¡¡
4¡£¡¡¡¡Ñ¡ÔñÎı¾¿òÖ®ÍâµÄÈÎÒâµ¥Ôª¸ñ¡¡¡¡
5¡£¡¡¡¡°´ÏÂAlt£«F11¼¤»îVB±à¼­Æ÷´°¿Ú£¬²¢ÇÒÑ¡Ôñ¹¤³Ìä¯ÀÀÆ÷´°¿ÚµÄPersonal¡¡£¨Personal¡£xls£©¡¡¡¡
6¡£¡¡¡¡Ñ¡Ôñ¡°²åÈ롱£­¡°Ä£¿é¡±£¬Ôö¼ÓÒ»¸öеÄÄ£¿é¡¡¡¡
7¡£¡¡¡¡ÔÚÊôÐÔ´°¿Ú£¬¸ø¸ÃÄ£¿éÖØÃüÃû£ºManipulations¡¡¡¡
8¡£¡¡¡¡Ñ¡Ôñ¡°ÊÓͼ¡±£­¡°¶ÔÏóä¯ÀÀÆ÷¡±£¬»ò°´F2¡¡¡¡
9¡£¡¡¡¡ÔÚ¡°¹¤³Ì/¿â¡±ÏÂÀ­Áбí¿òÀïÑ¡Ôñ¡°Excel¡±Àà¡¡¡¡
10¡£¡¡ÔÚËÑË÷¿òÀïÊäÈë¡°textbox¡±²¢µã»÷ËÑË÷°´Å¥¡£È·±£ÄãûÓÐÔÚÎÄ×Ö¼äÇÃÈë¿Õ¸ñ¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡55¡¡

¡­¡¡Ò³Ãæ¡¡72¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­18¡¡Excel¡¡ÔÚ¹¤×÷±íÉÏÃæµÄÃû³Æ¿òÀïÏÔʾ²åÈëµÄ¶ÔÏóÃû³Æ¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­19¡¡Ê¹ÓöÔÏóä¯ÀÀÆ÷´°¿Ú£¬Äã¿ÉÒÔÕÒµ½ºÏÊʵÄVBAÖ¸ÁîÀ´±àдÄã×Ô¼ºµÄ¹ý³Ì¡¡¡¡
ÏÔʾµÄ½á¹û±íÃ÷¶ÔÏóShapesÕƹÜÎÒÃÇÎı¾¿ò²Ù×÷£¨²Î¼ûͼ2£­19£©¡£´Ó³ÉÔ±ÁбíÇåµ¥ÉÏ¿´£¬Äã¿ÉÒԺܡ¡
¿ì¾ÍÖªµÀAddTextbox·½·¨¾ÍÊÇÓÃÀ´ÔÚ¹¤×÷±íÀïÌí¼ÓÎı¾¿òµÄ·½·¨¡£´úÂë¸ñʽ´°¿ÚÏÔʾÁËʹÓø÷½·¨¡¡
µÄÕýÈ·Óï·¨¡£Èç¹ûÄãÑ¡ÔñAddTextbox·½·¨²¢ÇÒ°´F1£¬Ä㽫¿´µ½¹ØÓÚËüµÄ°ïÖú´°¿Ú£¬ÓиüÏêϸµÄ¹ØÓÚ¡¡
Èç¹ûʹÓø÷½·¨µÄÐÅÏ¢£¨²Î¼ûͼ2£­20£©¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡56¡¡

¡­¡¡Ò³Ãæ¡¡73¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ2£­20¡¡Òª»ñÈ¡¶ÔÏóä¯ÀÀÆ÷ÕÒµ½µÄÈκÎÏîÄ¿ÏêϸÐÅÏ¢£¬Ö»ÒªÑ¡ÔñÕû¸öÏîÄ¿²¢ÇÒ°´F1¾Í¿ÉÒÔÁË¡¡¡¡
µ±Äãϸ¿´AddTextbox·½·¨µÄ×Ô±äÁ¿ºÍËüÃÇÔÚ°ïÖú´°¿ÚÉϵĽâÊÍʱ£¬Äã¾Í¿ÉÒԺܿìµØÖªµÀÎı¾¿òÔÚ¹¤¡¡
×÷±íÖеÄλÖÃÊÇÓÉLeftºÍTopÊôÐÔÀ´¾ö¶¨µÄ¡£ÄãÐèÒª×öµÄÖ»ÊÇ·µ»Ø´úÂë´°¿Ú£¬±àдָÁîÀ´Òƶ¯Îı¾¡¡
¿òµ½¹¤×÷±íµÄ×óÉÏ·½¡£¡¡¡¡
11¡£¡¡¹Ø±Õ¶ÔÏóä¯ÀÀÆ÷ºÍ°ïÖú´°¿Ú£¨Èç¹ûËüÃÇ»¹ÊÇ´ò¿ªµÄ£©¡¡¡¡
12¡£¡¡Ë«»÷ManipulationsÄ£¿é£¬ÊäÈë¹ý³ÌMoveTextBox£º¡¡¡¡
Sub¡¡MoveTextBox£¨£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡With¡¡ActiveSheet¡£Shapes£¨¡¨Text¡¡box¡¡1¡¨£©¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡®Text¡¡box¡¡1ÔÚÖÐÎÄ°æ±¾ÀïΪ¡°Îı¾¿ò¡¡¡¡
1¡±¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Select¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Left¡¡=¡¡0¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Top¡¡=¡¡0¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡With¡¡¡¡¡¡
End¡¡Sub¡¡¡¡
13¡£¡¡Ñ¡Ôñ¡°ÔËÐС±£­¡°ÔËÐкꡱÀ´²âÊÔÕâ¸ö¹ý³Ì¡¡¡¡
µ±Äã·µ»Øµ½·ÅÖøÃÎı¾¿òµÄ¹¤×÷±íʱ£¬¸ÃÎı¾¿òÒѾ­Òƶ¯µ

·µ»ØĿ¼ ÉÏÒ»Ò³ ÏÂÒ»Ò³ »Øµ½¶¥²¿ ÔÞ£¨0£© ²È£¨0£©

Äã¿ÉÄÜϲ»¶µÄ