ÓÑÇéÌáʾ£ºÈç¹û±¾ÍøÒ³´ò¿ªÌ«Âý»òÏÔʾ²»ÍêÕû£¬Çë³¢ÊÔÊó±êÓÒ¼ü¡°Ë¢Ð¡±±¾ÍøÒ³£¡
Excel word ppt officeʹÓü¼ÇÉ´óÈ«(DOC¸ñʽ)-µÚ34²¿·Ö
¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·ҳ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿! Èç¹û±¾ÊéûÓÐÔĶÁÍ꣬ÏëÏ´μÌÐø½Ó×ÅÔĶÁ£¬¿ÉʹÓÃÉÏ·½ "Êղص½ÎÒµÄä¯ÀÀÆ÷" ¹¦ÄÜ ºÍ "¼ÓÈëÊéÇ©" ¹¦ÄÜ£¡
RANGE£¨srArea£©¡£SELECT¡¡¡¡¡¡¡¡
»ØÓ¦2£ºÎÒ¾õµÃ¸÷Óг¤´¦£¬Èç¹ûÓбäÁ¿ÐèҪѻ·Åжϣ¬ÓÃCellsÏà¶Ô±È½Ï¼òµ¥£¬µ«ÊÇÓÐʱºò¹Ì¶¨¡¡
ÇøÓòµÄ£¬ÃüÃûºóÓÃRange¸üÁé»î¡£¡¡¡¡
»ØÓ¦3£ºÃ»´í¡£¡¡¡¡°ïÖúÖÐÒ²ÊÇÍƼö¡¡CELL¡¡¡¡µÄ¡£¡¡¡¡¡¡
Áé»îÐÔÀ´½²£»¡¡RANGE¡¡¡¡ÒªÇ¿¶àÁË£»¡¡¡¡¶øÇÒʹÓÃʱ¿ÉÒÔͨ¹ý¡¡¡£¡¡¡¡ÌáÈ¡·û¿ìËÙ¶ÁÈ¡ËüµÄÊôÐԺͷ½·¨¡£¡¡¡¡¡¡
ÁíÍ⣻¡¡¡¡¶ÔÓڿɱä¸üµÄ¹¤×÷±í£»¡¡¡¡Óá¡RANGE¡¡¡¡À´²Ù×÷ÃüÃûÇøÓò½«Ôö¼Ó³ÌÐòµÄµ¯ÐÔ¡£¡¡¡¡¡¡
±ÈÈ繤×÷ÖвåÈëÒ»ÐÐ/ÁУ»¡¡¡¡VBA¡¡¡¡ÖÐÓá¡CELL¡¡¡¡¾Í¿ÉÄܵ¼ÖÂÔËÐвÙ×÷´íÎ󣻡¡¡¡¶ø¡¡RANGE£¨srArea£©¡¡¡¡×÷¡¡
Ϊָ¶¨ÇøÓò£»¡¡¡¡¿ÉÊÊÓ¦µ¥Ôª¸ñµÄÕâÀà±ä¸ü¡£¡¡¡¡¡¡
031¡£¹ØÓÚFileSystemObjectµÄÒýÓá¡¡¡
ÇëÎʸ÷·¸ßÊÖ£¬ÓÐÈË¿ÉÒÔΪÎÒÖ¸µãÒ»ÏÂfilesystemobjectÒýÓõÄÏêϸ˵Ã÷£¬ÌرðÊÇfileexists·½·¨¡¡
µÄʵÀý¡£¡¡¡¡¡¡
½â´ð£ºSub¡¡testing£¨£©¡¡¡¡¡¡¡¡
'ÏÈÅжÏÎļþÊÇ·ñ´æÔÚ£¬ÊÇÔòɾ³ýÖ®¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXIV¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡235¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
Dim¡¡strmyfile¡¡As¡¡String¡¡¡¡¡¡¡¡
strmyfile¡¡=¡¡¡¨d£ºbook1¡£xls¡¨¡¡¡¡¡¡¡¡
If¡¡filetoFind£¨strmyfile£©¡¡Then¡¡¡¡¡¡¡¡
Kill¡¡strmyfile¡¡¡¡¡¡¡¡
End¡¡If¡¡¡¡¡¡¡¡
End¡¡Sub¡¡¡¡¡¡¡¡
Function¡¡filetoFind£¨fileName¡¡As¡¡String£©¡¡As¡¡Boolean¡¡¡¡¡¡¡¡
Dim¡¡fsobj¡¡As¡¡Object¡¡¡¡¡¡¡¡
Set¡¡fsobj¡¡=¡¡CreateObject£¨¡¨Scripting¡£FileSystemObject¡¨£©¡¡¡¡¡¡¡¡
If¡¡fsobj¡£fileexists£¨fileName£©¡¡Then¡¡¡¡¡¡¡¡
filetoFind¡¡=¡¡True¡¡¡¡¡¡¡¡
End¡¡If¡¡¡¡¡¡¡¡
End¡¡Function¡¡¡¡¡¡¡¡
ÔÚ°ïÖúÎļþÖÐÊÇÕâÑùÃèÊöµÄ£ºFileSystemObject¡¡¡¡¶ÔÏó¡¡¡¡
ÃèÊö£ºÌṩ¶Ô¼ÆËã»úÎļþϵͳµÄ·ÃÎÊ¡£¡¡¡¡¡¡
Óï·¨£ºScripting¡£FileSystemObject¡¡¡¡¡¡¡¡
˵Ã÷£ºÏÂÃæµÄ´úÂë¾ÙÀý˵Ã÷ÁËÈçºÎʹÓá¡FileSystemObject¡¡¡¡·µ»ØÒ»¸ö¡¡TextStream¡¡¡¡¶ÔÏ󣬸öԡ¡
ÏóÊǿɶÁ²¢¿ÉдµÄ£º¡¡¡¡¡¡
Set¡¡fs¡¡=¡¡CreateObject£¨¡¨Scripting¡£FileSystemObject¡¨£©¡¡¡¡¡¡¡¡
Set¡¡a¡¡=¡¡fs¡£CreateTextFile£¨¡¨c£ºtestfile¡£txt¡¨£»¡¡True£©¡¡¡¡¡¡¡¡
a¡£WriteLine£¨¡¨This¡¡is¡¡a¡¡test¡£¡¨£©¡¡¡¡¡¡¡¡
a¡£Close¡¡¡¡¡¡¡¡
ÔÚÉÏÃæÁгöµÄ´úÂëÖУ¬CreateObject¡¡¡¡º¯Êý·µ»Ø¡¡FileSystemObject¡¡£¨fs£©¡¡¡£CreateTextFile¡¡¡¡·½·¨½Ó¡¡
×Å´´½¨Îļþ×÷Ϊһ¸ö¡¡TextStream¡¡¡¡¶ÔÏó£¨a£©£¬¶ø¡¡WriteLine¡¡¡¡·½·¨ÔòÏò´´½¨µÄÎı¾ÎļþÖÐдÈëÒ»¡¡
ÐÐÎı¾¡£Close¡¡¡¡·½·¨Ë¢Ð»º³åÇø²¢¹Ø±ÕÎļþ¡£¡¡¡¡
FileExists¡¡¡¡·½·¨¡¡¡¡
ÃèÊö£ºÈç¹ûÖ¸¶¨µÄÎļþ´æÔÚ£¬·µ»Ø¡¡True¡¡£¬Èô²»´æÔÚ£¬Ôò·µ»Ø¡¡False¡£¡¡¡¡
Óï·¨£ºobject¡£FileExists£¨filespec£©¡¡¡¡¡¡¡¡
FileExists¡¡¡¡·½·¨Óï·¨ÓÐÈçϼ¸²¿·Ö£º¡¡¡¡¡¡
²¿·Ö¡¡ÃèÊö£ºobject¡¡¡¡±ØÐèµÄ¡£Ê¼ÖÕÊÇÒ»¸ö¡¡FileSystemObject¡¡¡¡µÄÃû×Ö¡£¡¡¡¡
filespec¡¡¡¡±ØÐèµÄ¡£ÒªÈ·¶¨ÊÇ·ñ´æÔÚµÄÎļþµÄÃû×Ö¡£Èç¹ûÈÏΪÎļþ²»ÔÚµ±Ç°Îļþ¼ÐÖУ¬±ØÐëÌṩ¡¡
Ò»¸öÍêÕûµÄ·¾¶ËµÃ÷£¨¾ø¶ÔµÄ»òÏà¶ÔµÄ£©¡£¡¡¡¡
032¡£excelʱ¼äº¯Êý2£¨²ËÄñ½Ì³Ì£©¡¡¡¡¡¡¡¡
ÕâÒ»Ìù˵Ã÷ʱ¼äº¯Êý£¬time£»hour£¬minute£»secondµÄÓ÷¨¡£¡¡¡¡
time¡¡µÄ¼ÆËã¹ý³Ì£º¡¡¡¡¡¡
time£¨hour£»minute£»second£©£¬timeµØ·µ»ØֵΪ0¡0¡£99999999Ö®¼äµÄÊýÖµ£¬ËüµÄ¼ÆËã·½·¨ÈçÏ£º¡¡¡¡¡¡
hourµÄ·¶Î§£º0¡24¡¡¡¡¡¡¡¡
minuteµÄ·¶Î§£º0¡59¡¡¡¡¡¡¡¡
secondµÄ·¶Î§£º0¡59¡¡¡¡¡¡¡¡
ÔÚÂú×ãÒÔÉÏÊäÈ뷶ΧµÄʱºò£ºtime£¨hour£»minute£»second£©=hour/24£«minute/£¨24*60£©£«second/¡¡
¡¡£¨24*60*60£©¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXV¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡236¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
È磺tiem£¨05¡¡£¬34£»29£©=0¡£232280092592593¡£ÈçºÎ¼ÆËãµÄÄØ£¿¡¡¡¡¡¡
5/24£«34/¡¡¡¡£¨24*60£©£«29/¡¡¡¡£¨24*60*60£©=0¡£208333333333333£«0¡£0236111111111111¡¡¡¡¡¡¡¡
£«0¡£000335648148148148=0¡£232280092592593¡£¡¡¡¡
ÔÚ°ïÖúÎļþÀﻹÓÐhour£»minute£»second²»ÔÙ·¶Î§Çé¿ö£¬Õâʱºò£¬ÈçºÎ¼ÆËãµÄÄØ£¿¡¡¡¡¡¡
1¡¢second/60£»³ýµÄÕûÊýΪminute£»mod£¨second£»60£©Îªsecond¡¡¡¡¡¡¡¡
2¡¢minute/60£¬³ýµÄÕûÊýΪhour£»mod£¨minute£»60£©Îªminute¡¡¡¡¡¡¡¡
3¡¢hour/24£¬mod£¨hour£»24£©Îªhour¡¡¡¡¡¡¡¡
×îºóÔÙÓÃhour/24£«minute/£¨24*60£©£«second/¡¡¡¡£¨24*60*60£©¼ÆËã¡£¡¡¡¡
°ïÖúÖеÄÀý×Ó£ºtime£¨0£»0£»2000£©=0¡£023148ÈçºÎËãµÄÄØ£¿¡¡¡¡¡¡
2000/60=33¡¡mod£¨2000£»60£©=20¡¡¡¡¡¡¡¡
time£¨0£»0£»2000£©=time£¨0£»33£»20£©=0/24£«33/£¨24*60£©=20/£¨24*60*60£©=0¡£023148¡¡¡¡¡¡¡¡
ºÇºÇ£¬ÆäʵûÓÐʲôÓ㬻áÓÃÕâ¸öº¯Êý¾Í¿ÉÒÔ¿É£¬ÈçºÎËãµÄ¾Í²»±ØÔÚÒâÁË£¡£¡£¡¡¡¡¡¡¡
033¡£ÄêÔÂÈÕµÄÎÊÌâ¡¡¡¡¡¡
EXCEL±í¸ñÖÐÄêÔÂÓÐʱºòÊäÈë²»¶Ô£¬£¨ÔçÒѼǼ¹ý´óÁ¿Êý¾Ý£¬¸ÄдÂé·³¡££©±ÈÈç198001£¬Òâ¡¡
˼ÊÇ1980Äê1Ô£¬¿ÉÊÇÉèÖõ¥Ôª¸ñʽÈÕÆÚÖ»ÓÐÄêÔÂÈÕ£¬Ã»ÓÐÄêÔ¡£Ôõô×ö£¿¡¡¡¡¡¡
½â¡¡´ð¡¡£º¡¡²å¡¡Èë¡¡Ò»¡¡¸¨¡¡Öú¡¡ÁС¡£¬¡¡¼Ù¡¡Éè¡¡198001¡¡ÔÚ¡¡E1¡¡£¬¡¡F=IF£¨MID£¨E1£»5£»1£©=¡¨0¡¨£»LEFT£¨E1£»4£©&¡¨¡¡Äê¡¡
¡¨&RIGHT£¨E1£»1£©&¡¨Ô¡¨£»LEFT£¨E1£»4£©&¡¨Äꡨ&RIGHT£¨E1£»2£©&¡¨Ô¡¨£©¡¡¡¡¡¡¡¡
ÊÔһϡ£¡¡¡¡
ÓÖÎÊ£º198001ÄÜ·ñ¸ÄΪ1980¡1£¿»òÕß1980Äê1Ô¸ÄΪ1980¡1£¿¡¡¡¡¡¡
½â´ð£ºf1=IF£¨MID£¨e1£»5£»1£©=¡¨0¡¨£»LEFT£¨e1£»4£©&¡¨¡¡¨&RIGHT£¨e1£»1£©£»LEFT£¨e1£»4£©&¡¨¡¡¨&RIGHT£¨e1£»2£©£©¡¡¡¡¡¡¡¡
»òÕ߸ü¼òµ¥Ò»Ð©£º=LEFT£¨A6£»4£©&¡¨¡¡¨&value£¨RIGHT£¨A6£»2£©£©¡¡¡¡£¨Êý¾ÝÔÚa6µ¥Ôª¸ñ£©¡¡¡¡¡¡
Ò²¿ÉÒÔÕâÑù£º=date£¨mid£¨e1£»1£»4£©£»mdi£¨e1£»5£»2£©£»1£©ÕâÑù»áÏÔʾΪ1980¡1¡1£¬È»ºó¿ÉÒÔËæÒâÉèÖóɡ¡
ÏàÓ¦µÄÈÕÆÚ¸ñʽ¡£¡¡¡¡
034¡£Çë°ïæ½âÊÍÒ»¸ö¹«Ê½¡¡¡¡
=LEFT£¨A1£»£¨SEARCHB£¨¡¨£¿¡¨£»A1£©¡1£©/2£©ÕâÊÇÎÒÔÚÕ¾ÄÚ¹ýÈ¥µÄÌû×ÓÀï¿´µ½µÄÒ»¸ö¹«Ê½£¬ÓÃÓÚÌáÈ¡Ç°¡¡
ÎĺóÊýÖеÄÎÄ×Ö²¿·Ö£¬·Ç³£ºÃÓá£Çë½ÌÕâ¸ö¹«Ê½ÖÐ×îºóÁ½²½µÄÒâÒåÊÇʲô£¿ÁíÍ⣬µ±A1ÊÇ¡°¡¡1234¡¡
¸ö¡±µÄ¸ñʽʱ£¬µ±ÈçºÎÌáÈ¡ÆäÖеÄÎÄ×ÖÄØ£¿¡¡¡¡¡¡
½â´ð£º1¡¢¹«Ê½µÄº¬ÒåÊÇ£º²éÕÒµÚÒ»¸ö°ë½Ç×Ö·û³öÏÖµÄλÖã§SEARCHB£¨¡¨£¿¡¨£»A1£©£§£¬¼õÈ¥1ºó³ýÒÔ¡¡
2£¬¾ÍÊÇÎÄ×ÖµÄ×Ö·ûÊýÄ¿£¬½«ÆäÌáÈ¡³öÀ´¡£¡¡¡¡
2¡¢=RIGHT£¨A1£»LENB£¨A1£©¡LEN£¨A1£©£©¡¡¡¡¡¡¡¡
035¡£¹ØÓÚºêºÍ³ÌÐò¡¡¡¡
ÎÒÏÖÔÚÒѾÓÃexcel±àÁËÒ»¸ö½ÏÍêÕûµÄ³ÌÐò£¬²¢ÇÒÄܹ»¸øÔ´³ÌÐò¼ÓÃÜÂ룬ʵÏÖ¡¨¹¤³Ì²»¿É¼û¡¨£¬¡¡
µ«ÊÇÎÒ·¢ÏÖÔÚvba±à¼»·¾³ÀﻹÄÜ¿´µ½ÎҵĴ󲿷ֺ꣬ËäȻ˵²»Äܱ༣¬µ«ÄÜÔËÐУ¬ÇëÎÊÈçºÎ¡¡
Òþ²ØÆðÀ´¡£¡¡¡¡¡¡
½â´ð£º²»ÓÃÄ£¿éº¯Êý£»ÖØд³ÉÀà»ò·Åµ½workbook¡¡ÖУ»»òÔÚ³ÌÐòÖÐÖ±½Ó½«²Ëµ¥ºêÒþ²Ø¡£»òÕߣºÐ½¨¡¡
À࣬Ȼºó½«Ä£¿éÖеijÌÐò¿½±´µ½À࣬Ìáʾ£ºÕÒ²»µ½ºê¡£¡¡¡¡
ÓÖÎÊ£ºÎÒÏÖÔÚÒѾÄÜ×öµ½ÆÁ±Îµ÷alt£«F11¼üÁË£¬ËäÈ»²»ÄÜ¿´µ½Îҵĺê³ÌÐò£¬µ«ÊÇÒÀÈ»¿ÉÒÔÔËÐС¡
Îҵĺ꣬Çë¸ßÊÖ×ö´ð£¬ÈçºÎÒþ²ØÆðÎҵĺꡣ¡¡¡¡
½â´ð£ºÔÚºêµÄÉùÃ÷Ç°¼ÓPrivate¡£¡¡¡¡
036¡£Çë½Ì¶àÌõ¼þÇóºÍµÄÎÊÌâ¡¡¡¡
´ó¼ÒºÃ£¬ÎÒÊǸöÐÂÊÖ£¬ÏëÏò´ó¼ÒÇë½ÌÖ¸¶¨¶àÌõ¼þÇóºÍµÄº¯Êý¹«Ê½¡£¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXVI¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡237¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
Æ©È磬ÓÐÒ»ÕŹ¤×÷±íÓÐ4ÁбêÌ⣺ƷÃû£¬ÊýÁ¿£¬ÈÕÆÚ£¬Ç©ÊÕÈË¡£¡¡¡¡
ÈôÎÒÏëÇ󣬷ûºÏÌõ¼þΪ£ºÆ·ÃûΪA¡¡£¬ÈÕÆÚΪY¡¡£¬Ç©ÊÕÈËΪBµÄÊýÁ¿Ö®ºÍ¡£¡¡¡¡
¸ÃÓÃÄǸöº¯Êý¹«Ê½£¿¡¡¡¡¡¡
½â´ð£º=IF£¨A2=¡¨a¡¨£»IF£¨B2=¡¨03¡£10¡£22¡¨£»COUNTIF£¨D£ºD£»D2£©£»¡¨Ê±¼äÎÞ¡¨£©£»¡¨ÎÞ¡¨£©¡¡¡¡¡¡¡¡
AÁÐÆ·Ãû£¬BÁÐÈÕÆÚ£¬CÁÐÊýÁ¿£¬DÁÐÇ©ÊÕÈËÓÃif¡¡¡¡Ç¶Ìס£¡¡¡¡
»òÕߣºÊý×鹫ʽ¡¡¡¡¡¡
£û=sum£¨£¨a1£ºa100=Æ·Ãû£©*£¨c1£ºc100=¡¡ÈÕÆÚ£©£¨d1£ºd100=Ç©ÊÕÈË£©*£¨B1£ºB100£©£©£ý¡¡¡¡¡¡¡¡
Ò²¿ÉÒÔ£º£û=SUM£¨£¨£¨A1£ºA100£©=¡¨a¡¨£©*£¨£¨B1£ºB100£©=¡¨03¡£10¡£22¡¨£©£©£ý¡¡¡¡¡¡¡¡
037¡£Çë½Ì¹ØÓÚÐÇÆڵļÆË㣿¡¡¡¡¡¡
ÈçºÎͨ¹ýÊäÈëÒ»¸öÈÕÆÚ£º2003¡10¡20¼´¿ÉµÃµ½¸ÃÌìÔÚ±¾Äê¶ÈµÄµÚ¼¸¸öÐÇÆÚ£¿¡¡¡¡¡¡
½â´ð£ºÊ¹Óá¡WEEKNUM¡¡¡¡º¯Êý¡£¡¡¡¡
È磺=WEEKNUM£¨A1£©¡¡¡¡¡¡
=WEEKNUM£¨TODAY£¨£©£©¡¡¡¡¡¡
»òÕߣºÈÕÆÚÔÚa1¡¡¡¡¡¡¡¡
=INT£¨£¨A1¡DATE£¨YEAR£¨A1£©£»1£»0£©£«WEEKDAY£¨DATE£¨YEAR£¨A1£©£»1£»0£©£»1£©£«7¡WEEKDAY£¨A1£»1£©£©/7£©¡¡¡¡¡¡¡¡
Ò²¿ÉÒÔÓÃVBA¡¡£º¡¡¡¡¡¡
'under¡¡the¡¡iso¡¡standard£»¡¡a¡¡week¡¡always¡¡begins¡¡on¡¡a¡¡monday£»¡¡and¡¡ends¡¡on¡¡a¡¡sunday¡£¡¡¡¡¡¡¡¡
'the¡¡first¡¡week¡¡of¡¡a¡¡year¡¡is¡¡that¡¡week¡¡which¡¡contains¡¡the¡¡first¡¡thursday¡¡of¡¡the¡¡year£»¡¡¡¡¡¡¡¡
'or£»¡¡equivalently£»¡¡contains¡¡jan¡4¡£¡¡¡¡¡¡¡¡
'¡¡¡¡¡¡¡¡
public¡¡function¡¡isoweeknum£¨anydate¡¡as¡¡date£»¡¡_¡¡¡¡¡¡¡¡
optional¡¡whichformat¡¡as¡¡variant£©¡¡as¡¡integer¡¡¡¡¡¡¡¡
'¡¡¡¡¡¡¡¡
'¡¡whichformat£º¡¡missing¡¡or¡¡¡¡2¡¡then¡¡returns¡¡week¡¡number£»¡¡¡¡¡¡¡¡
'¡¡=¡¡2¡¡then¡¡yyww¡¡¡¡¡¡¡¡
'¡¡¡¡¡¡¡¡
dim¡¡thisyear¡¡as¡¡integer¡¡¡¡¡¡¡¡
dim¡¡previousyearstart¡¡as¡¡date¡¡¡¡¡¡¡¡
dim¡¡thisyearstart¡¡as¡¡date¡¡¡¡¡¡¡¡
dim¡¡nextyearstart¡¡as¡¡date¡¡¡¡¡¡¡¡
dim¡¡yearnum¡¡as¡¡integer¡¡¡¡¡¡¡¡
thisyear¡¡=¡¡year£¨anydate£©¡¡¡¡¡¡¡¡
thisyearstart¡¡=¡¡yearstart£¨thisyear£©¡¡¡¡¡¡¡¡
previousyearstart¡¡=¡¡yearstart£¨thisyear¡¡¡¡1£©¡¡¡¡¡¡
nextyearstart¡¡=¡¡yearstart£¨thisyear¡¡£«¡¡1£©¡¡¡¡¡¡¡¡
select¡¡case¡¡anydate¡¡¡¡¡¡¡¡
case¡¡is¡¡¡·=¡¡nextyearstart¡¡¡¡¡¡¡¡
isoweeknum¡¡=¡¡£¨anydate¡¡nextyearstart£©¡¡¡¡7¡¡£«¡¡1¡¡¡¡¡¡¡¡
yearnum¡¡=¡¡year£¨anydate£©¡¡£«¡¡1¡¡¡¡¡¡¡¡
case¡¡is¡¡¡¶¡¡thisyearstart¡¡¡¡¡¡¡¡
isoweeknum¡¡=¡¡£¨anydate¡¡previousyearstart£©¡¡¡¡7¡¡£«¡¡1¡¡¡¡¡¡¡¡
yearnum¡¡=¡¡year£¨anydate£©¡¡¡¡1¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXVII¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡238¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
case¡¡else¡¡¡¡¡¡¡¡
isoweeknum¡¡=¡¡£¨anydate¡¡thisyearstart£©¡¡¡¡7¡¡£«¡¡1¡¡¡¡¡¡¡¡
yearnum¡¡=¡¡year£¨anydate£©¡¡¡¡¡¡¡¡
end¡¡select¡¡¡¡¡¡¡¡
if¡¡ismissing£¨whichformat£©¡¡then¡¡¡¡¡¡¡¡
exit¡¡function¡¡¡¡¡¡¡¡
end¡¡if¡¡¡¡¡¡¡¡
if¡¡whichformat¡¡=¡¡2¡¡then¡¡¡¡¡¡¡¡
isoweeknum¡¡=¡¡cint£¨format£¨right£¨yearnum£»¡¡2£©£»¡¡¡¨00¡¨£©¡¡&¡¡_¡¡¡¡¡¡¡¡
format£¨isoweeknum£»¡¡¡¨00¡¨£©£©¡¡¡¡¡¡¡¡
end¡¡if¡¡¡¡¡¡¡¡
end¡¡function¡¡¡¡¡¡¡¡
public¡¡function¡¡yearstart£¨whichyear¡¡as¡¡integer£©¡¡as¡¡date¡¡¡¡¡¡¡¡
dim¡¡weekday¡¡as¡¡integer¡¡¡¡¡¡¡¡
dim¡¡newyear¡¡as¡¡date¡¡¡¡¡¡¡¡
newyear¡¡=¡¡dateserial£¨whichyear£»¡¡1£»¡¡1£©¡¡¡¡¡¡¡¡
weekday¡¡=¡¡£¨newyear¡¡2£©¡¡mod¡¡7¡¡¡¡¡¡¡¡
if¡¡weekday¡¡¡¶¡¡4¡¡then¡¡¡¡¡¡¡¡
yearstart¡¡=¡¡newyear¡¡weekday¡¡¡¡¡¡¡¡
else¡¡¡¡¡¡¡¡
yearstart¡¡=¡¡newyear¡¡weekday¡¡£«¡¡7¡¡¡¡¡¡¡¡
end¡¡if¡¡¡¡¡¡¡¡
end¡¡function¡¡¡¡¡¡¡¡
038¡£Çë½ÌÈÕÆÚµÄת»»ÎÊÌâ¡¡¡¡
ÎҵijÌÐòÀïÓÐÕâÑùÒ»¶Î´úÂ룺¡¡¡¡¡¡
Dim¡¡str¡¡As¡¡Date¡¡¡¡¡¡¡¡
str=now¡¡¡¡¡¡¡¡
Sheet1¡£Cells£¨1£»¡¡¡¨A¡¨£©¡¡=¡¡str¡¡¡¡¡¡¡¡
ÔËÐкóÔÚµ¥Ôª¸ñÀïÏÔʾ¡¡¡¡
2003/11/13¡¡15£º19£º45¡¡¡¡¡¡¡¡
µ«ÎÒÏëÈÃËüÏÔʾ³ÉÈçϵĸñʽ£º¡¡¡¡¡¡
¡¡£²£°£°£³Ä꣱£±Ô£±£³ÈÕ£¨Ð¡Ê±£¬·Ö£¬ÃëÈ¥µô£©¡¡¡¡¡¡
ÎÒÓÃyear¡¡¡¡£¨str£©Ïëµ¥¶ÀÈ¡µÃÄêµÄÖµ£¬µ«ÏÔʾ1905/06/25¡¡0£º00£º00¡¡¡¡¡¡
ÇëÎÊÓÐʲôºÃµÄ·½·¨¿ÉÒÔʵÏÖÕâÖÖת»»Â𣿡¡¡¡¡¡
½â´ð£º¡¡¡¡¡¡
Dim¡¡str¡¡As¡¡Date¡¡¡¡¡¡¡¡
str=now¡¡¡¡¡¡¡¡
Sheet1¡£Cells£¨1£»¡¡¡¨A¡¨£©¡¡=¡¡format£¨str£»¡¨yyyyÄêmmÔÂdd¡¡ÈÕ¡¨£©¡¡¡¡¡¡¡¡
039¡£ÈçºÎÓÃvbaʵÏÖɾ³ý×îÓұߵÄ×Ö·û¡¡¡¡
1Ô¡¢2Ô¡¢3Ô¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£¡£10Ô¡¢11Ô¡¢12Ô¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXVIII¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡239¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
ÇëÎÊÈçºÎÓÃvbaʵÏÖ°Ñ¡°Ô¡±É¾³ýÖ»ÌáÈ¡£º1¡¢2¡¢3¡£¡£¡£¡£¡£¡£¡£10¡¢11¡¢12¡£¡¡¡¡
½â´ð£ºSub¡¡abc£¨£©¡¡¡¡¡¡¡¡
Dim¡¡a¡¡As¡¡Integer¡¡¡¡¡¡¡¡
Dim¡¡b¡¡As¡¡String¡¡¡¡¡¡¡¡
Dim¡¡c¡¡As¡¡String¡¡¡¡¡¡¡¡
c¡¡=¡¡¡¨¡¨¡¡¡¡¡¡¡¡
For¡¡a¡¡=¡¡1¡¡To¡¡Len£¨b£©¡¡¡¡¡¡¡¡
c¡¡=¡¡c¡¡&¡¡IIf£¨Mid£¨b£»¡¡a£»¡¡1£©¡¡¡¡¡¨Ô¡¨£»¡¡Mid£¨b£»¡¡a£»¡¡1£©£»¡¡¡¨¡¨£©¡¡¡¡¡¡¡¡
Next¡¡¡¡¡¡¡¡
MsgBox¡¡c¡¡¡¡¡¡¡¡
End¡¡Sub¡¡¡¡¡¡¡¡
»òÕߣº¡¡¡¡¡¡
A1=¡¡1Ô¡¢2Ô¡¢3Ô¡¢4Ô¡¢5Ô¡¢6Ô¡¢7Ô¡¢8Ô¡¢9Ô¡¢10Ô¡¢11Ô¡¢12Ô¡¡¡¡
£§A1£§¡¡=¡¡Application¡£WorksheetFunction¡£Substitute£¨£§A1£§£»¡¡¡¨Ô¡¨£»¡¡¡¨¡¨£©¡¡¡¡¡¡¡¡
040¡£ÇëÎÊÈçºÎ¶¨ÒåÏà¶Ô¶¨Î»µÄÃû³Æ¡¡¡¡
ÎÒÏ붨ÒåÒ»¸ö¸÷¸ö¹¤×÷±í£¨Ò»¸ö¹¤×÷±¡ÄÚ£©Ê¹ÓõÄÃû³Æ¡£¸ÃÃû³ÆΪÏà¶Ô¶¨Î»£¬¡¡¡¡¡¡
ÈçÎÒÔÚsheet1±íµÄB2ÖиÃÃû³ÆÊÇ¡¡sheet1¡¡¡¡±íµÄA2¡¡£¬ÎÒÔÚsheet2±íµÄB2ÖÐʱ¸ÃÃû³ÆÊÇsheet2±í¡¡
µÄA2µ¥Ôª¸ñ£¬¿ÉÎÒÔÚ¶¨ÒåÃû³ÆʱËü×ÜÊǼÓÉϹ¤×÷±íÃû¡£¡¡¡¡
½â´ð£º=offset£¨indirect£¨address£¨row£¨£©£»column£¨£©£»£©£©£»£»¡1£»£»£©¡¡¡¡¡¡
041¡£ÇëÎÊÈçºÎÌæ»»£¿¡¡¡¡¡¡
ÓкܶàÌõÕâÑùµÄ¼Ç¼£º******£¨212£©£»****£¨315£©£»*********£¨658£©¡¡¡£ÈçºÎÖ»±£ÁôÀ¨ºÅÀïµÄÊý×Ö£¬¡¡
*ºÅÊǺº×Ö¡£¡¡¡¡
½â´ð£ºÉèÊý¾ÝÔÚA30µ¥Ôª¸ñ¡¡=MID£¨A30£»FIND£¨¡¨£¨¡¨£»A30£©£«1£»LEN£¨A30£©¡FIND£¨¡¨£¨¡¨£»A30£©¡1£©¡¡¡¡¡¡
IF¡¡¡¡ÄãµÄÊý¾Ý¶¼ÊÇÒªÇó¼Ç¼ÖÐ×îºóÃæµÄÈýÂëÊý×Ö¡¡¡¡
¿ÉÒÔÊÔ×ÅÓüòµ¥µÄ·½Ê½½â¾ö¡¡¡¡¡¡
=RIGHT£¨A1£»3£©¡¡¡¡¡¡
ÓÖÎÊ£ºÎÒÊÇÒªºÏ²¢£¬ÄãÈ´Òª²ð·Ö£¡ÄãÄܸæËßÎÒÔõÑù½«Á½ÁУº¼´¡°Êý×ÖÁС±ºÍ¡°ÎÄ×ÖÁС±ºÏ²¢³ÉÒ»ÁУ¿¡¡¡¡¡¡
½â´ð£ºÊÔÊÔÕâ¸ö£º¡¡¡¡¡¡
Sub¡¡Join£¨£©¡¡'½«Ñ¡ÔñµÄÐм¸¸öµ¥Ôª¸ñÊýÖµºÏ²¢µ½Ò»ÁеÄÒ»¸öµ¥Ôª¸ñ¡¡¡¡¡¡
Application¡£ScreenUpdating¡¡=¡¡False¡¡¡¡¡¡¡¡
Application¡£Calculation¡¡=¡¡xlCalculationManual¡¡¡¡¡¡¡¡
On¡¡Error¡¡Resume¡¡Next¡¡¡¡¡¡¡¡
Dim¡¡iRows¡¡As¡¡Long£»¡¡mRow¡¡As¡¡Long£»¡¡ir¡¡As¡¡Long£»¡¡ic¡¡As¡¡Long¡¡¡¡¡¡¡¡
iRows¡¡=¡¡Selection¡£Rows¡£Count¡¡¡¡¡¡¡¡
Set¡¡lastcell¡¡=¡¡Cells¡£SpecialCells£¨xlLastCell£©¡¡¡¡¡¡¡¡
mRow¡¡=¡¡lastcell¡£Row¡¡¡¡¡¡¡¡
If¡¡mRow¡¡¡¶¡¡iRows¡¡Then¡¡iRows¡¡=¡¡mRow¡¡'not¡¡best¡¡but¡¡better¡¡than¡¡nothing¡¡¡¡¡¡¡¡
iCols¡¡=¡¡Selection¡£Columns¡£Count¡¡¡¡¡¡¡¡
For¡¡ir¡¡=¡¡1¡¡To¡¡iRows¡¡¡¡¡¡¡¡
newcell¡¡=¡¡Trim£¨Selection¡£Item£¨ir£»¡¡1£©¡£value£©¡¡¡¡¡¡¡¡
For¡¡ic¡¡=¡¡2¡¡To¡¡iCols¡¡¡¡¡¡¡¡
trimmed¡¡=¡¡Trim£¨Selection¡£Item£¨ir£»¡¡ic£©¡£value£©¡¡¡¡¡¡¡¡
If¡¡Len£¨trimmed£©¡¡¡¡0¡¡Then¡¡newcell¡¡=¡¡newcell¡¡&¡¡¡¨¡¡¡¨¡¡&¡¡trimmed¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡CCXXXIX¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Page¡¡240¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡
¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡¡Excel_word_ppt_ʹÓü¼ÇÉ´óÈ«£¨ÍêÈ«°æ£©¡¡¡¡
Selection¡£Item£¨ir£»¡¡ic£©¡¡=¡¡¡¨¡¨¡¡¡¡¡¡¡¡
Next¡¡ic¡¡¡¡¡¡¡¡
Selection¡£Item£¨ir£»¡¡1£©¡£value¡¡=¡¡newcell¡¡¡¡¡¡¡¡
Next¡¡ir¡¡¡¡¡¡¡¡
Application¡£Calculation¡¡=¡¡xlCalculationAutomatic¡¡¡¡¡¡¡¡
Application¡£ScreenUpdating¡¡=¡¡True¡¡¡¡¡¡¡¡
End¡¡Sub¡¡¡¡¡¡¡¡
042¡£Çó½ÌºÏ²¢µ¥Ôª¸
¿ì½Ý²Ù×÷: °´¼üÅÌÉÏ·½Ïò¼ü ¡û »ò ¡ú ¿É¿ìËÙÉÏÏ·ҳ °´¼üÅÌÉ쵀 Enter ¼ü¿É»Øµ½±¾ÊéĿ¼ҳ °´¼üÅÌÉÏ·½Ïò¼ü ¡ü ¿É»Øµ½±¾Ò³¶¥²¿!
ÎÂÜ°Ìáʾ£º ο´Ð¡ËµµÄͬʱ·¢±íÆÀÂÛ£¬Ëµ³ö×Ô¼ºµÄ¿´·¨ºÍÆäËüС»ï°éÃÇ·ÖÏíÒ²²»´íŶ£¡·¢±íÊéÆÀ»¹¿ÉÒÔ»ñµÃ»ý·ÖºÍ¾Ñé½±Àø£¬ÈÏÕæдԴ´ÊéÆÀ ±»²ÉÄÉΪ¾«ÆÀ¿ÉÒÔ»ñµÃ´óÁ¿½ð±Ò¡¢»ý·ÖºÍ¾Ñé½±ÀøŶ£¡