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

[µo°Ý] ¦p¦ó¼g¦Û°Ê¶}±Ò¦P¤é´Á¡BÃþ¦üÀɮתºµ{¦¡ (¤w¸Ñ¨M)

[µo°Ý] ¦p¦ó¼g¦Û°Ê¶}±Ò¦P¤é´Á¡BÃþ¦üÀɮתºµ{¦¡ (¤w¸Ñ¨M)

¥»©«³Ì«á¥Ñ haoxhui ©ó 2011-3-26 09:36 ½s¿è

Q¡G
¶}±Ò¡u2011_03_23¡vªºexcelÀÉ«á¡A°õ¦æ¦Û°Ê¶}±Ò¡u20110323¡vªºÀÉ¡A
¦P²z
¶}±Ò¡u2011_03_24¡vªºexcelÀÉ«á¡A°õ¦æ¦Û°Ê¶}±Ò¡u20110324¡vªºÀÉ¡A
½Ð°Ýµ{¦¡À³¦p¦ó¼g©O¡H

¦]¬°¨â­Ó¨t²Î¨C¤Ñ³£·|¦U²£¥X¤@­ÓÀɮצWºÙÃþ¦üªºÀɮסA
¬°¤F¤ñ¸û¤ÀªR¤º®e¡A
¨C¤Ñ³£­n­«½Æªº¶}±Ò¤ñ¸û¡A
¯uªº«Ü³Â·Ð¡A
·Q½Ð±Ð¦U¦ì°ª¤âÀ³¦p¦ó¼g³o­Óµ{¦¡¡A
·P®¦§o~

¦^´_ 1# haoxhui
Workbooks.Open Replace(ActiveWorkbook.FullName, "_", "")

TOP

¦^´_ 2# GBKEE


ª©¥D¡A±z¯u¬O¤Ó¯«©_¤F¡I
¶â¡A¬O¤Ó¼F®`¤F¡I
±R«ô¡I±R«ô¡I
§Ú¤@ª½¦bÆp¤û¨¤¦y¡A·Q»¡ÀɮצWºÙÀ³¸Ó­n«ç»ò©î¦r¥À¡A
¨S·Q¨ì³o»ò²³æ´N¸Ñ¨M¤F¡D¡D¡D¡D

¨º§Ú¥i¥H°Ý²`¤J¤@ÂI¶Ü¡H
¨ä¹ê¨â­ÓÀɮצWºÙ¤À§O¬O¡G¡uA_2010_03_23¡v¡B¡uB20100323¡v
¦Ó¥B¤À¶}¦b¨â­Ó¸ê®Æ§X¤º¡A
½Ð°Ý³o¼Ëµ{¦¡­n«ç»ò¼g©O¡H

«Ü©êºp§Ú¨S¦³¤@¦¸±Ô­z²M·¡¡A
³y¦¨§xÂZÁٽШ£½Ì¡I
~¾Ç¦Ó¤£«ä«hªÉ¡A«ä¦Ó¤£¾Ç«h¬p~
~¥H¥v¬°Ãè¥i¥Hª¾¿³´À¡A¥H¤H¬°Ãè¥i¥H©ú±o¥¢~

TOP

Workbooks.Open "C:\Documents and Settings\Administrator\My Documents\A\" & Replace(Replace(ActiveWorkbook.Name, "_", ""), "A", "B")

·í¤¤C:\Documents and Settings\Administrator\My Documents\A¬OB2010xxxxªº¸ê®Æ§¨¦ì¸m
80 ¦r¸`¥H¤º
¤£¤ä«ù¦Û©w¸q Discuz! ¥N½X

TOP

¦^´_ 3# haoxhui
§AÁÙ¨S»¡©ú ¡uA_2010_03_23¡v¡B¡uB20100323¡v
¨âªÌ ¬O±q A-B ÁÙ¬O ±q B-A  ¶}±Ò
¤U¦Cµ{¦¡½X¬O
Right(string, length)  ¶Ç¦^¤@¦r¦ê¥kÃä¯S©w¼Æ¶q¦r¤¸©Òºc¦¨ªº Variant (String)¡C
¨ç¼Æªº¥Îªk
  1. Sub Ex()
  2.     Dim A(1), B(1)
  3.     A(0) = "D:\"
  4.     B(0) = "D\TEST\"
  5.     A(1) = "A_2010_03_23"
  6.     B(1) = "B20100323"
  7.     A(1) = Right(Replace(A(1), "_", ""), 8)
  8.     B(1) = Right(B(1), 8)
  9.     Workbooks.Open A(0) & A(1)
  10.     Workbooks.Open B(0) & B(1)
  11. End Sub
½Æ»s¥N½X

TOP

¦^´_ 5# GBKEE

·PÁ¡uª©¥D¡v©M¡uFAlonso¡v ¤j¤j¡A
§ÚªºÀɮ׬O¥Ñ A ¶} B¡A
ª©¥D©Ò±Ðªºreplace§Ú·|½m²ßªº¡A
­è­è§Ú¤@ª½¦b¡u´¢´ú¡v¦pªG¦³¨â­Ó¦a¤è¥H¤Wreplaceªº¼gªk¡A
FAlonso¤j¤j±Ð¤F§Ú¡A«D±`·PÁ¡I
¦Óª©¥D²Ä2­Óµ{¦¡·Pı¬O¤ñ¸û¦³ÅÞ¿è¡A
¦ý¦Ñ¹ê»¡§Ú¬O¦³ÂI¬Ý¤£À´°Õ¡A
§Ú·|¦A½m²ß¬Ý¬Ýªº¡I

¦Ó§Ú³o­Ó°ÝÃD§Ú±ß¤WºN¯Á®É¤w¸g§JªA¤F¡A
§Úªº¸Ñ¨M¤èªk¦³ÂI°½Âû¡A
¦]¬°§Úµo²{AÀɮפ¤¦³¤@­Ó©T©wªºÄæ¦ì·|Åã¥Ü¤é´Á¡A
¦Ó¥B´N¬OBÀɮתº®æ¦¡20110323¡A
©Ò¥H§Ú±Nµ{¦¡¼g¬°¡G
   file_name= Sheets(1).Range("A3").Value
    Workbooks.Open filename:="D:\DailyB\B" & file_name

Á`¤§¯S§O·PÁª©¥Dªº¼ö¤ß¦^ÂСA
§Ú·|°w¹ïª©¥Dªº¤èªkÄ~Äò½m²ß¤Îºë¶iªº¡A
·P®¦¦A·P®¦¡I
~¾Ç¦Ó¤£«ä«hªÉ¡A«ä¦Ó¤£¾Ç«h¬p~
~¥H¥v¬°Ãè¥i¥Hª¾¿³´À¡A¥H¤H¬°Ãè¥i¥H©ú±o¥¢~

TOP

        ÀR«ä¦Û¦b : ¤Ñ¤W³Ì¬ü¬O¬P¬P¡A¤H¥Í³Ì¬ü¬O·Å±¡¡C
ªð¦^¦Cªí ¤W¤@¥DÃD