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

[µo°Ý] ¨Dfilelist¦n¤èªk

[µo°Ý] ¨Dfilelist¦n¤èªk

§Ú­n¨ú±o«ü©wfolder¨½©Ò¦³filesªºlist,°µ¤F¦ý¤ÓºC(5040­Ófile,°µ§¹list(on fly)¤j·§3¤ÀÄÁ),½Ð¨D«üÂI,¨D¦n¤èªk.
ªþ¥ó¤Ó¤j,¤£¯àupload,¤j·§¬O
2012\   A,B,C.....L,M,N(¦@14­Ófolder)\    1¤ë,2¤ë........11¤ë,12¤ë(¦@12­Ófolder)\    01.xlsx,02xlsx,......29.xlsx,30xlsx(¦@30­Ófile)
¦X­p14*12*30=5040­Ó¤å¥ó,§Æ±æ¨ú±oArr(1 to 5040), Arr(1)="2012\A\1¤ë\01xlsx", Arr(2)="2012\A\1¤ë\02.xlsx"........Arr(5040)="2012\N\12¤ë\30.xlsx"
¤èªk¤@©w«Ü¦h,§Ú¨úloop¦º°Ù,©Ò¥H«ÜºC......½Ð±Ð¦n¤èªk,ÁÂÁ¤F
lmh

¥»©«³Ì«á¥Ñ GBKEE ©ó 2013-7-19 17:57 ½s¿è

¦^´_ 1# mhl9mhl9
¸Õ¸Õ¬Ý
  1. Option Explicit
  2. Sub Ex()
  3.     Dim S(1 To 3) As String, i As Integer, ii As Integer, iiI As Integer, xDir As String, AR()
  4.     S(1) = "D:\2012\"
  5.     For i = 65 To Asc("N")                  'A - N
  6.         S(2) = S(1) & Chr(i)
  7.         For ii = 1 To 12                    '1¤ë-12¤ë
  8.             S(3) = S(2) & "\" & ii & "¤ë\"
  9.             xDir = Dir(S(3) & "*.xlsx")
  10.             Do While xDir <> ""
  11.                 ReDim Preserve AR(0 To iiI)
  12.                 AR(iiI) = S(3) & xDir
  13.                 iiI = iiI + 1
  14.                 xDir = Dir
  15.             Loop
  16.         Next
  17.     Next
  18. End Sub
½Æ»s¥N½X
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

¦^´_ 2# GBKEE

¯u¬O¤Ó·PÁ§A¤F,²ª½¤@¬íÄÁ¥X¨Ó¤F,§Ö¹L§Ú¦º°Ù180­¿,¦Ó¥B¤S³o»ò§Ö´NÀ°§Ú¸Ñ¨M¤F.
¬JµM¦³©¯¨£¨ì¦p¦¹°ª¤â,·Q¦A½Ð±Ð­Ó°ÝÃD:
§Ú¥ÎADO¦b§Ú¤W­z´£¨ìªº5124­Ó¤å¥ó(ªºlist¨½ªº¤å¥ó)¨ú¸ê®Æ,¨C­Ó¤å¥óªºsheet1¨½ªº"B63:AN111"copy¨ìthisworkbook¨½sheets(Temp")(±qA1°_©¹¤U±Æ)
­n14¤ÀÄÁ,(ÁÙ¬Ointel 4®Ö win7+excel2007),¬O¤£¬O«Ü¸Ø±i?¦³¦nÂIªº¤èªk¶Ü?
(°µ³o­Ófile,§Ú¬O²Ä¤@¨B¨ú±ofilelist,¦Aloop¨C­Ófile,¥ÎADO³v±i¨ú¥X"B63:an111"±Æ¶¤©ñ¦b"Temp"­¶,¦A±qTemp¾ã²z¸ê®Æ©ñ¶i"¸ê®Æ®w"­¶,5124­Ó¤å¥ó,170210±ø(row)¸ê®Æ,16¤ÀÄÁ
¨Ï¥Î¤Hªº¹q¸£¥i¯àÁÙ¨S¦³³o»ò§Ö,©Ò¥H¯àÀ°§Ú·Q·Q¤èªk¶Ü? À°¨ì¤£À°¨ì,§Ú³£­n¦b³o¸Ì¦hÁÂ.
lmh

TOP

¦^´_ 3# mhl9mhl9
Temp¾ã²z¸ê®Æ©ñ¶i"¸ê®Æ®w"­¶,5124­Ó¤å¥ó,170210±ø(row)¸ê®Æ,16¤ÀÄÁ
³o¤w¸g«Ü§Ö¤F
·P®¦ªº¤ß......(¦b³Â»¶®a±Ú°Q½×°Ï.¥Î¤ß¾Ç²ß·|¦³¶i¨Bªº)
¦ý¸ê·½µL­­,«á´©¦³­­,  ¤@¤Ñ1¤¸ªºÃÙ§U,¤H¤H¦³¯à¤O.

TOP

        ÀR«ä¦Û¦b : °µ¦n¨Æ¤£¯à¤Ö§Ú¤@¤H¡A°µÃa¨Æ¤£¯à¦h§Ú¤@¤H¡C
ªð¦^¦Cªí ¤W¤@¥DÃD