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

µÚ16²¿·Ö

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

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

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



ÎÊÌâµÄÐÐÓûÆÉ«Í»³ö³öÀ´¡£ÔÚÄã¸üÕý´úÂëºó£¬VB¿ÉÄܻᵯ³öÐÅÏ¢£º¡°Õâ¸ö²Ù×÷½«»áÖØÖÃÄãµÄ¹¤³Ì£¬¡¡
¼ÌÐø£¿¡±µã»÷È·¶¨¡£¾¡¹ÜÄã¿ÉÒÔÔÚÖжÏģʽÐ޸ĴúÂ룬µ«ÊÇ£¬ÓÐЩÐ޸ĻáÖÕÖ¹ºêµÄ¼ÌÐøÖ´ÐС£¸üÕý¡¡
ºê´úÂëºó£¬ÖØÐÂÔËÐÐËü£¬Ò²ÐíÄã»áÐèÒª½â¾ö¸ü¶àµÄ´íÎó£¬Ö®ºó²ÅÄÜ˳ÀûµØÔËÐÐËü¡£Ä㽫ÔÚµÚ¶þÕº͡¡
µÚÊ®ÈýÕÂÀïÃæѧµ½¸ü¶àµÄ¹ØÓÚÈçºÎ´¦ÀíVBA´íÎóµÄ·½·¨¡£¡¡¡¡

11¡¡Á½¸ö²ãÃæÔËÐкêµÄ·½·¨¡¡¡¡

Äã¼È¿ÉÒÔÔÚExcel½çÃæÔËÐк꣬Ҳ¿ÉÒÔÔÚVB±à¼­Æ÷½çÃæÔËÐÐËü¡£µ±Äã´ÓVB±à¼­Æ÷ÆÁĻִÐС¡
WhatsInACellʱ£¬VBÔÚÆÁĻ֮ºóÖ´ÐÐÕâЩ´úÂë¡£Äã¿´²»µ½VBÑ¡ÔñºÍÉèÖøñʽ£¬Ò²¿´²»µ½VB²åÈëÈý¿Õ¡¡
ÐÐ×öͼÀý¡£ÎªÁ˹۲쵽VBµÄÖ´ÐÐÇé¿ö£¬Äã±ØÐëÔÚExcel½çÃ棬ͨ¹ýÑ¡Ôñ¡°¹¤¾ß¡±£­¡°ºê¡±£¬»òÕß½«Äã¡¡
Excel½çÃæºÍVB±à¼­Æ÷½çÃæͬʱÏÔʾÔÚµçÄÔÆÁÄ»ÉÏ£¨²Î¼ûͼ1£­6£©¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡24¡¡

¡­¡¡Ò³Ãæ¡¡41¡­

¡¡¡¡
ͼ1£­6¡¡Èç¹ûÄã´ÓVB±à¼­Æ÷ÔËÐкêʱ£¬Ïë¹Û²ìºêµÄÔËÐÐÇé¿ö£¬Äã±ØÐ뽫Excel½çÃæºÍVB±à¼­Æ÷²¢Åŵء¡
²¼ÖÃÔÚÒ»Æð¡¡¡¡
°´ÕÕÏÂÁв½ÖèÀ´²¢ÅŲ¼ÖÃÄãµÄExcel½çÃæºÍVB±à¼­Æ÷½çÃ棺¡¡¡¡
1£®¡¡¡¡ÔÚÈÎÎñÀ¸ÉϵĿհ״¦µ¥»÷ÓÒ¼ü¡£ÈÎÎñÀ¸ÔÚÆÁÄ»µÄ϶ˣ¬¡°¿ªÊ¼¡±°´Å¥µÄλÖᣡ¡¡¡
2£®¡¡¡¡ÏÂÁв˵¥ÖУ¬Ñ¡Ôñ¡°×ÝÏòƽÆÌ´°¿Ú¡±¡¡¡¡
3£®¡¡¡¡×îС»¯ÄÇЩ²»ÐèÒªµÄ´°¿Ú£¬Öظ´²½Öè1¡¡¡¡
4£®¡¡¡¡ÏÖÔÚ£¬Á½¸ö´°¿Ú²¢ÅÅÏÔʾÁË£¬µã»÷´úÂëµÄÈÎÒâλÖã¬È»ºó°´Ï¡°F5¡±£¨»òÕßÑ¡Ôñ¡°ÔËÐС±£­¡°ÔË¡¡
¡¡¡¡¡¡¡¡¡¡ÐÐÄ£¿é/´°Ì塱£©¡£×øºÃ£¬¹Û²ìÄã¼ÖƵĺêÔÚÔËÐУ¬²»ÊǺܼ¤¶¯Âð£¿ÉÔºó£¬Ä㽫ѧϰÈçºÎ½«VBÂý¡¡
¡¡¡¡¡¡¡¡¡¡ÂýÔËÐУ¬ÕâÑùÄã¡¡¾Í¿ÉÒÔÒ»²½Ò»²½µØ¹Û²ìºê´úÂëµÄÔËÐÐÇé¿ö¡£¡¡¡¡

12¡¡ÍêÉÆÄãµÄºê´úÂë¡¡¡¡

¼Öƺêºó£¬Äã¿ÉÄܻᷢÏÖºê¿ÉÒÔ½øÐÐһЩ±ðµÄ²Ù×÷¡£Èç¹ûÄãÒѾ­ÊìϤÁËVBÓïÑÔ£¬ÒªÍùºêÀïÃæ¼ÓÖ¸Áî¡¡
²¢²»ÊÇÒ»¼þÀ§ÄѵÄÊÂÇ顣Ȼ¶ø£¬ÔÚ¾ø´ó¶àÊýÇé¿öÏ£¬Äã¿ÉÒÔ½«ÕâЩ¹¤×÷½»¸øExcelºê¼ÖÆÆ÷£¬´Ó¶ø¡¡
¸üÓÐЧµØÍê³ÉÕâÏ×÷¡£ÄãÒ²Ðí»á˵£¬Excel¼ÖÆÁËÌ«¶àµÄ²»ÐèÒªµÄÖ¸Áî¡£µ«ÊÇ£¬¿Ï¶¨µÄÊÇ£¬ºê¼¡¡
ÖÆÆ÷²»»á·¸´í£¬ÄãÍêÈ«¿ÉÒÔÒÀÀµÓÚËü¡£¡¡¡¡
Èç¹ûÄãÏëҪͨ¹ýºê¼ÖÆÆ÷ÔÚÄãµÄ´úÂëÀïÌí¼ÓÖ¸ÁÄÇôÄã±ØÐë¼ÖÆÒ»¸öк꣬Ȼºó¸´ÖÆÐèÒªµÄ²¿·Ö¡¡
ÔÙÕ³Ìùµ½Ô­À´´úÂëµÄÕýȷλÖᣡ¡¡¡
ÎÒÃÇÀ´¸øA1£ºB3Ìí¼Ó´Ö±ß¿ò£º¡¡¡¡
1£®¡¡¡¡¼¤»îͼ1£­6¿´µ½µÄExcel½çÃæ¡¡¡¡
2£®¡¡¡¡Ñ¡Ôñ¡°¹¤¾ß¡±£­¡°ºê¡±£­¡°Â¼ÖÆкꡱ¡¡¡¡
3£®¡¡¡¡ÔÚºê¶Ô»°¿òµã»÷È·¶¨£¬½ÓÊÜĬÈϵĺêÃû²¢¿ªÊ¼Â¼ÖÆ¡¡¡¡
4£®¡¡¡¡Ñ¡ÔñÇøÓòA1£ºB3¡¡¡¡
5£®¡¡¡¡Ñ¡Ôñ¡°¸ñʽ¡±£­¡°µ¥Ôª¸ñ¡±£¬µã»÷¡°±ß¿ò¡±Ò³¡¡¡¡
6£®¡¡¡¡ÔÚ¡°±ß¿òÑùʽ¡±²¿·Ö£¬µã»÷¡°Íⲿ¡±°´Å¥¡¡¡¡
7£®¡¡¡¡Ôڱ߿ò´ÖϸÁÐ±í£¬µã»÷×î´ÖµÄ£¬ÔÙµã»÷È·¶¨¹Ø±Õ¶Ô»°¿ò¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡25¡¡

¡­¡¡Ò³Ãæ¡¡42¡­

8£®¡¡¡¡µã»÷µ¥Ôª¸ñA1¡£×¢Ò⣬A1£ºB3ÇøÓòÓÐÁ˴ֱ߿ò¡£¡¡¡¡
9£®¡¡¡¡µã»÷¡°Í£Ö¹Â¼ÖÆ¡±°´Å¥£¬»òÕßÑ¡Ôñ¡°¹¤¾ß¡±£­¡°ºê¡±£­¡°Í£Ö¹Â¼ÖÆ¡±¡¡¡¡
Çл»ÖÃVB±à¼­Æ÷´°¿Ú£¬²é¿´Äã¼ÖƵĺꡣ¸øA1£ºB3£¨ÒëÕߣºÔ­ÎÄΪA1£ºA3£©Ìí¼Ó´Ö±ß¿òµÄ´úÂëÈçÏ£º¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡Sub¡¡Macro2£¨£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡'¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡'¡¡Macro2¡¡Macro¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡'¡¡Macro¡¡recorded¡¡5/31/2002¡¡by¡¡Julitta¡¡Korol¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡'¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡'¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Range£¨¡¨A1£ºB3¡¨£©¡£Select¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Selection¡£Borders£¨xlDiagonalDown£©¡£LineStyle¡¡=¡¡xlNone¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Selection¡£Borders£¨xlDiagonalUp£©¡£LineStyle¡¡=¡¡xlNone¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡With¡¡Selection¡£Borders£¨xlEdgeLeft£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£LineStyle¡¡=¡¡xlContinuous¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Weight¡¡=¡¡xlThick¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lorIndex¡¡=¡¡xlAutomatic¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡With¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡With¡¡Selection¡£Borders£¨xlEdgeTop£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£LineStyle¡¡=¡¡xlContinuous¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Weight¡¡=¡¡xlThick¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lorIndex¡¡=¡¡xlAutomatic¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡With¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡With¡¡Selection¡£Borders£¨xlEdgeBottom£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£LineStyle¡¡=¡¡xlContinuous¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Weight¡¡=¡¡xlThick¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lorIndex¡¡=¡¡xlAutomatic¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡With¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡With¡¡Selection¡£Borders£¨xlEdgeRight£©¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£LineStyle¡¡=¡¡xlContinuous¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡£Weight¡¡=¡¡xlThick¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡lorIndex¡¡=¡¡xlAutomatic¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡With¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Selection¡£Borders£¨xlInsideVertical£©¡£LineStyle¡¡=¡¡xlNone¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Selection¡£Borders£¨xlInsideHorizontal£©¡£LineStyle¡¡=¡¡xlNone¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Range£¨¡¨A1¡¨£©¡£Select¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡End¡¡Sub¡¡¡¡¡¡
ÏÖÔÚ£¬ÎÒÃÇÀ´·ÖÎöÒ»ÏÂÕâЩ¼ÖƵĴúÂë¡£ÄãÈÏΪÄã¿ÉÒÔÈ¥µôÆäÖеÄһЩָÁîÂð£¿ÔÚÄãɾ³ýÕâЩ²»±Ø¡¡
ÒªµÄ´úÂë֮ǰ£¬¿¼ÂÇʹÓÃ×¢ÊÍ¡£ÔÚÄãɾ³ýÈκδúÂë֮ǰ£¬Ç뽫ËüÃÇ×¢Ê͵ô£¬È»ºóÔËÐкꡣÈç¹ûVB¡¡
ûÓгöÏÖÈκδíÎóÐÅÏ¢£¬ÄÇôÄã¾Í¿ÉÒÔ°²È«µØɾ³ýÕâЩ±»×¢ÊÍÁ˵ĴúÂë¡£Èç¹ûÿ´Î¶¼°´ÕÕÕâ¸öÖ¸µ¼¡¡
˼Ï룬Äã¾Í²»»áÖظ´Â¼ÖÆÏàͬµÄ²Ù×÷ÁË¡£Èç¹ûÕâ¸öºêÃüÁîûÓÐÕýÈ·µØÔËÐУ¬ÄÇôÄãÐèҪȥµô¸Õ²ÅµÄ¡¡
×¢ÊÍ£¬±Ï¾¹£¬ÕâЩ´úÂë¿ÉÄÜÊDZØÐëµÄ¡£¹ØÓÚ×¢Ê͵ÄÏêϸÐÅÏ¢£¬²Î¼ûµÚ¶þÕ¡£¡¡¡¡
µ±ÄãʹÓúê¼ÖÆÆ÷À´´´½¨ºêµÄʱºò£¬Äã¿ÉÒԺܿìµØÕÆÎÕExcel²Ëµ¥Ñ¡ÏîºÍ¶Ô»°¿òÉèÖÃÔÚVBAÀïµÄµÈͬ¡¡
·½·¨¡£È»ºó£¬Äã¿ÉÒÔÔÚÔÚÏß°ïÖúÀïÃæ²éÕÒÕâЩVBÖ¸ÁîµÄÒâ˼ºÍÓ÷¨¡£ºÜÏÔÈ»£¬VBÒªÖ´ÐÐÔ½¶àµÄÖ¸Á¡¡
ºêÔËÐеÄËٶȾÍÔ½Âý¡£È¥µôÄÇЩÎ޹ؽôÒªµÄÃüÁî»á¼ÓËÙºêµÄÔËÐС£È»¶ø£¬ÎªÁËʹÄãµÄ´úÂëÈÝÒ×Àí½â£¬¡¡
ÄãÐèÒª´÷ÉÏÄãµÄÕì̽ñ×Ó£¬Ñ°Çó×î¼Ñ;¾¶¡£ÀýÈ磬¿´Ò»ÏÂÄã¼ÖƵĸøÑ¡Öеĵ¥Ôª¸ñ¼ÓÍâ¿òµÄºê¡£¿´¡¡
ÉÏÈ¥£¬ºê¼ÖÆÆ÷ÊÇÔÚ·Ö±ðµØ¸øÿһÌõÏß½øÐÐÉèÖá£VBûÓÐÒ»¸ö¼òµ¥µÄÒ»¾äÃüÁîÀ´¸øÑ¡ÖеÄÇøÓò¼ÓÍâ¡¡
±ß¿ò£¬ÕâËƺõºÜÄÑÀí½â¡£Ñ§Ï°ÈκÎÓïÑÔÖÐÕýÈ·µÄ´ÊÓïºÍ±í´ïÊǺܷÑʱµÄ¡£Ê±¼äÒ»³¤£¬Äã»á·¢ÏÖVB¡¡
ʵ¼ÊÉÏÓÐÒ»¸öÁíÍâµÄ·½·¨BorderAroundÈÃÄãÔÚµ¥Ôª¸ñÇøÓòÌí¼Ó±ß¿òºÍÉèÖÃÑÕÉ«£¬ÏßÐͺÍб߿òµÄ´Ö¡¡
ϸ¡£ÏÂÃæµÄÓï¾äÊÇVBAÖиøÑ¡Öеĵ¥Ôª¸ñÉèÖÃÍâΧ´Ö±ß¿òµÄ×î¼Ñ·½·¨£º¡¡¡¡
¡¡¡¡¡¡¡¡Range£¨¡¨A1£ºB3¡¨£©¡£BorderAround¡¡Weight£º=xlThick¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡26¡¡

¡­¡¡Ò³Ãæ¡¡43¡­

ÉÏÃæµÄÖ¸ÁîʹÓÃRange¶ÔÏóµÄBorderAround·½·¨¡£Ëü¸øA1£ºB3ÇøÓòÌí¼ÓÁËÒ»¸ö´ÖÏßÍâ¿ò¡££¨ÏÂÒ»Õº­¡¡
¸ÇÁËVB¶ÔÏó£¬ÊôÐԺͷ½·¨£©¡£¡¡¡¡
ÏÖÔÚÎÒÃǽ«ÉÏÃæµÄÖ¸Áî¼Óµ½ºêWhatsInACellÀïÃæÈ¥£º¡¡¡¡
1£®¡¡¡¡¼¤»îº¬ÓкêWhatsInACellµÄ´úÂë´°¿Ú¡¡¡¡
2£®¡¡¡¡ÔÚActiveCell¡£FormulaR1C1¡¡=¡¡¡¨Formulas¡¨Ö®ºó²åÈëÒ»ÐС¡¡¡
3£®¡¡¡¡ÔÚ¿Õ°×ÐмÓÈëÒÔÏÂÖ¸Á¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡Range£¨¡¨A1£ºB3¡¨£©¡£BorderAround¡¡Weight£º=xlThick¡¡4¡¡¡¡
4£®¡¡¡¡¹â±ê·ÅÔÚºê´úÂëµÄÈκÎλÖ㬰´F5ÔËÐÐÐ޸ĺõĴúÂë¡£¡¡¡¡
¼¼ÇÉ1£­7£º¸½¼ÓÖ¸Áî¡¡¡¡
ÒªÔÚÏÖ´æµÄ´úÂëÖÐÌí¼ÓÖ¸ÁîµÄ»°£¬Í¨¹ýÔÚÐèÒªµÄλÖð´»Ø³µ¼ü¼ÓÈë¿Õ°×ÐУ¬²¢ÇÒÊäÈë±ØÒªµÄVBÓï¾ä¡£¡¡
Èç¹û¸½¼ÓÖ¸ÁîÊǼüÅ̲Ù×÷»ò²Ëµ¥ÃüÁîµÄ»°£¬Äã¿ÉÒÔʹÓúê¼ÖÆÆ÷À´´´½¨±ØÒªµÄ´úÂ룬Ȼºó½«ËüÃǸ´¡¡
ÖÆÕ³Ìùµ½Ô­À´µÄºêÀïÃæ¡£¡¡¡¡
¼ÙÉèÄãÏëÒªVBÔÚÖ´ÐÐÍê×îºóÒ»ÐдúÂëʱ¸øÄãÌáʾ£¬ÕâÖÖ²Ù×÷ÊDz»¿ÉÄܱ»Â¼ÖÆÏÂÀ´µÄ£¬ÒòΪExcelû¡¡
ÓÐÏàÓ¦µÄ²Ëµ¥Ñ¡Ïî¡£µ«ÊÇ£¬Äã¿ÉÒÔÊÖ¶¯Ê¹ÓÃVBÓïÑÔÔÚÄãµÄ´úÂëÀïÃæÌí¼ÓÖ¸Áî¡£¡¡¡¡
1£®¡¡¡¡ÔÚ´úÂë´°¿ÚÏ£¬ÔÚEnd¡¡SubÇ°»Ø³µ¡¡¡¡
2£®¡¡¡¡¹â±ê·ÅÔÚ¿Õ°×ÐУ¬ÊäÈëÏÂÁÐÓï¾ä£º¡¡¡¡
¡¡¡¡¡¡¡¡MsgBox¡¡¡¨ËùÓвÙ×÷¶¼ÒÑÍê³É¡£¡¨£¨ÒëÕߣºÓ¢ÎÄ״̬ϵÄÒýºÅ¡££©¡¡¡¡
3£®¡¡¡¡È·±£¹â±êÔÚ´úÂëÀ°´ÏÂF5¡¡¡¡
4£®¡¡¡¡VBÖ´ÐÐÍê×îºóÒ»¸öÖ¸Áîºó£¬µ¯³öÕâ¸öÐÅÏ¢¡£µã»÷È·¶¨¡£ÄãÏÖÔÚÖªµÀºêÒѾ­ÔËÐÐÍê³É¡£¡¡¡¡
MsgBoxÊÇÓõ÷dz£Æµ·±µÄVBAº¯ÊýÖ®Ò»£¬Ä㽫ÔÚµÚËÄÕÂÖÐѧϰËüµÄʹÓᣡ¡¡¡

13¡¡ÖØÐÂÃüÃûºê¡¡¡¡

ÔÚ´úÂëÀïÃæÌí¼ÓÁËһЩ´úÂëºó£¬ÎªÁ˸üºÃµØ·´Ó³Õâ¸öºêµÄÄ¿µÄ£¬ÄãÐèÒª½«Æä¸ÄÃû¡£¹ý³ÌµÄÃû³ÆÓ¦¸Ã¡¡
Ô½½Ó½üËüµÄ¹¦ÄÜÔ½ºÃ¡£Äã²»ÐèÒª°´Èκμü¾Í¿ÉÒÔ¸ü¸ÄºêÃû¡£ÔÚ´úÂë´°¿Ú£¬Ä㽫¹Ø¼ü´ÊSubºóÃæÀϵġ¡
ºêÃûÇå³ý£¬²¢ÇÒ´òÈëеÄÃû³Æ¼´¿É¡£¡¡¡¡

14¡¡ÔËÐкêµÄÆäËü·½·¨¡¡¡¡

µ½ÏÖÔÚΪֹ£¬ÄãÒѾ­Ñ§Ï°ÁËÔËÐкêµÄ·½·¨¡£ÄãÒѾ­ÖªµÀͨ¹ýÑ¡Ôñ¡°¹¤¾ß¡±£­¡°ºê¡±£­¡°ÔËÐкꡱÀ´¡¡
ÔËÐкꡣ²»ÐÒµÄÊÇ£¬Èç¹ûÄãÐèÒª¾­³£ÔËÐк꣬ÕâÖÖ·½·¨ÊDz»·½±ãµÄ¡£ÄãÒ²¿ÉÒÔÔÚVB±à¼­Æ÷´°¿ÚʹÓá¡
¿ì½Ý¼üF5»òÕßͨ¹ýÑ¡Ôñ¡°ÔËÐС±£­¡°ÔËÐÐÄ£¿é/´°Ì塱À´ÔËÐкꡣ´ËÍ⣬Ä㻹¿ÉÒÔÔÚVB±à¼­Æ÷´°¿Ú¡¡
µã»÷±ê×¼¹¤¾ßÀ¸Éϵİ´Å¥À´ÔËÐк꣨¼ûͼ1£­7£©¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ1£­7¡¡VB¹ý³Ì¿ÉÒÔͨ¹ý±ê×¼¹¤¾ßÀ¸À´ÔËÐС¡¡¡

15¡¡Ê¹ÓüüÅÌ¿ì½Ý¼üÔËÐкꡡ¡¡

Á÷Ðеķ½·¨ÊÇͨ¹ýÉèÖÃÒ»¸ö¿ì½Ý¼üÀ´ÔËÐкꡣ°´Ctrl£«Shift£«D±È´Óºê¶Ô»°¿ò¼¤»îºêÒªÈÝÒ׵öࡣÄã¡¡
±ØÐë¸øºêÉèÖÃÒ»¸ö¿ì½Ý¼ü£¬Ö®ºó²ÅÄÜʹÓÃËü¡£¡¡¡¡
1£®¡¡¡¡°´Alt£«F8¿ìËÙ´ò¿ªºê¶Ô»°¿ò¡¡¡¡
2£®¡¡¡¡µã»÷ºêÇåµ¥ÀïµÄWhatsInACell£¬È»ºóÑ¡ÔñÑ¡Ïî°´Å¥¡¡¡¡
3£®¡¡¡¡µ¯³öºêÑ¡Ïî¶Ô»°¿ò£¬Èçͼ1£­8¡£¹â±ê¶¨Î»ÔÚ¿ì½Ý¼üÎı¾¿òÀï¡¡¡¡
4£®¡¡¡¡°´ÏÂShift¼üºÍ¼üÅÌÊǵÄ×ÖĸI¡£Excel¼ÖÆÏÂÁË¿ì½Ý¼üCtrl£«Shift£«I¡¡¡¡
5£®¡¡¡¡µã»÷È·¶¨ÒԹرպêÑ¡Ïî¶Ô»°¿ò¡¡¡¡
6£®¡¡¡¡µã»÷È¡Ïû·µ»Ø¹¤×÷±í¡£ÊÔÊÔÓÃÄã¸ÕÉèÖõĿì½Ý¼üÀ´ÔËÐк꣬ȷ±£¼¤»îÁËExcel´°¿Ú£¬È»ºó°´Ï¡¡
¡¡¡¡¡¡¡¡¡¡Ctrl£«Shift£«I¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡27¡¡

¡­¡¡Ò³Ãæ¡¡44¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ1£­8¡¡Ê¹ÓúêÑ¡Ïî¶Ô»°¿òÉèÖüüÅÌ¿ì½Ý¼üÀ´ÔËÐкꡡ¡¡
¼¼ÇÉ1£­8£º±ÜÃâ¿ì½Ý¼ü³åÍ»¡¡¡¡
Èç¹ûÄã¸øºêÉèÖõĿì½Ý¼üºÍExcelÄÚÖõĿì½Ý¼ü³åÍ»£¬¶øÇÒÄã´ò¿ªµÄÓÖÕýÊǺ¬ÓÐÄǸöºêµÄ¹¤×÷±í£¬¡¡
ÄÇô°´Ï¸ÿì½Ý¼üºóExcel»áÔËÐÐÄã×Ô¼ºµÄºê¡£¡¡¡¡

16¡¡Í¨¹ý²Ëµ¥ÔËÐкꡡ¡¡

Èç¹ûÄãÄþԸͨ¹ý²Ëµ¥À´ÔËÐк꣬ÄÇôÄã¿ÉÒÔ½«ÄãµÄºê×ö³ÉÒ»¸ö²Ëµ¥Ñ¡ÏʹÓá°×Ô¶¨Òå²Ëµ¥¡±¶Ô»°¡¡
¿ò£¬Äã¿ÉÒÔ¿ìËٵĽ«ÄãµÄºêÃüÁî¼ÓÈëµ½ÈκÎExcelµÄÄÚÖò˵¥ÖС£¡¡¡¡
1£®¡¡¡¡ÔÚExcel½çÃ湤¾ßÀ¸µÄ¿Õ°×´¦£¬µ¥»÷ÓÒ¼ü£¬Ñ¡Ôñ¡°×Ô¶¨Òå²Ëµ¥¡±¡¡¡¡
2£®¡¡¡¡ÔÚ×Ô¶¨Òå²Ëµ¥¶Ô»°¿òÑ¡Ôñ¡°ÃüÁҳ¡¡¡¡
3£®¡¡¡¡ÔÚ¡°Àà±ð¡±Çåµ¥ÀïÑ¡Ôñ¡°ºê¡±¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ1£­9¡¡´´½¨×Ô¶¨Òå²Ëµ¥£¨µÚÒ»²½£©¡¡¡¡
4£®¡¡¡¡½«¡°×Ô¶¨Òå²Ëµ¥¡±ÍÏÒ·ÖÁ¹¤¾ß²Ëµ¥ÀïÈ¥¡£µ±¹¤¾ß²Ëµ¥Õ¹¿ªÊ±£¬Äã¿ÉÒÔ½«°´Å¥·ÅÔÚÈÎÒâµØ·½¡£¡¡
¡¡¡¡¡¡¡¡¡¡Í¼1£­10ÏÔʾÁË×Ô¶¨Òå²Ëµ¥ÔÚ¹¤¾ß²Ëµ¥µÄ×îÏÂÃæ¡£¡¡¡¡

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡28¡¡

¡­¡¡Ò³Ãæ¡¡45¡­

¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
ͼ1£­10¡¡´´½¨×Ô¶¨Òå²Ëµ¥£¨µÚ¶þ²½£©£¬Äã¿ÉÒÔ½«×Ô¶¨Òå²Ëµ¥·ÅÔÚExcel²Ëµ¥ÀҲ¿ÉÒÔ·ÅÔÚ×Ӳ˵¥Àï¡¡¡¡
5£®¡¡¡¡Ôڲ˵¥ÏîÉϵ¥»÷ÓÒ¼ü£¬²¢ÇÒÔÚ¿ì½Ý²Ëµ¥¡°Ãû³Æ¡±µÄÎı¾¿òÀ½«Æä¸Ä³ÉÄãÏëÒªµÄÃû×Ö£¨²Î¼û¡¡
¡¡¡¡¡¡¡¡¡¡Í¼1£­11£©¡£ÀýÈ磬½«Ãû³Æ¸ÄΪ¡°Contents¡¡of¡¡Ce&lls¡±¡£Á¬½Ó·ûÓÃÒÔ±íʾ¼üÅÌ¿ì½Ý¼ü¡£½«Á¬½Ó¡¡
¡¡¡¡¡¡¡¡¡¡·û·ÅÔÚÄãÏëÏÔʾÏ»®ÏßµÄ×Ö·û֮ǰ¡£Õâ¸ö×Ô¶¨Òå²Ëµ¥½«»áÏÔʾΪ¡°Contents¡¡of¡¡Cells¡±£¬×¢¡¡
¡¡¡¡¡¡¡¡¡¡Ò⣬²Ëµ¥ÀïÃæ×ÖÓë×ÖÖ®¼ä¿ÉÒÔÓпոñ¡£¡¡¡¡
6£®¡¡¡¡Ñ¡Ôñ×îºóÒ»¸öÑ¡Ï¿ì½Ý²Ëµ¥ÉÏ£©¡ª¡ª¡°Ö¸¶¨ºê¡±£¨²Î¼ûͼ1£­11£©¡£ÔÚºê¶Ô»°¿ò£¬Ñ¡Ôñºê¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡°WhatsInACell¡±£¬µã»÷È·¶¨£¬¹Ø±Õ×Ô¶¨Òå²Ëµ¥¶Ô»°¿ò¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡ÏÖÔÚ£¬ÄãµÄºê¿ÉÒÔͨ¹ý×Ô¶¨Òå²Ëµ¥À´ÔËÐÐÁË¡£Èç¹ûÄãûÓиø×Ô¶¨Òå²Ëµ¥Ñ¡ÏîÖ¸¶¨ºê¾Í¹Ø±ÕÁË¡¡
¡¡¡¡¡¡¡¡¡¡Õâ¸ö¿ì½Ý²Ëµ¥£¬ExcelÔÚÄãµÚÒ»´ÎÊÔͼʹÓÃÕâ¸ö×Ô¶¨Òå²Ëµ¥Ñ¡Ïîʱ»áÌáʾÄãÒªºêÃû¡£¡¡¡¡
7£®¡¡¡¡Ñ¡Ôñ¡°¹¤¾ß¡±£­¡°Contents¡¡of¡¡Cells¡±£¬»òÕß°´Alt£«TºÍlÀ´ÔËÐкꡣÈç¹ûÄãÔÚ×öÉÏÊö²Ù×÷ʱ£¬¡¡
¡¡¡¡¡¡¡¡¡¡Çå³ýÁËÄÚÖò˵¥»ò²Ëµ¥Ñ¡Ï¿ÉÒÔ´ò¿ª×Ô¶¨Òå²Ëµ¥¶Ô»°¿ò£¬µã»÷¹¤¾ßÒ³£¬È»ºóÑ¡Ôñ¡°ÖØÖᱡ¡
¡¡¡¡¡¡¡¡¡¡°

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

Äã¿ÉÄÜϲ»¶µÄ