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

[µo°Ý] ¸ê®Æ§¨°ÝÃD½Ð¯q

[µo°Ý] ¸ê®Æ§¨°ÝÃD½Ð¯q

¥»©«³Ì«á¥Ñ child ©ó 2011-9-28 14:35 ½s¿è

­Y·Q¦C¥XD:\TESTùتº©Ò¦³¸ê®Æ§¨¥]§t¤l¸ê®Æ§¨ªº¦WºÙ©M­×§ï®É¶¡¡A¥Ø«e´ú¸Õªºµ{¦¡¥u¯à¦C¥XD:\TESTùتº¸ê®Æ§¨¡A¦ýµLªk¦C¥X¤l¸ê®Æ§¨¡C
Ex:
D:\TEST¦³AA©MAB........µ¥¸ê®Æ§¨¡A¦ýAA©MAB¸ê®Æ§¨ùؤS¦³01¡B02........µ¥¸ê®Æ§¨¡A·Q±N¸ê®Æ§e²{¦p¤U:

¥D¸ê®Æ§¨  ¤l¸ê®Æ§¨  ³Ì²×­×§ï®É¶¡
AA              01            2011/9/24  02:23:32
AA              02            2011/9/24  01:33:32
AA              03            2011/9/25  08:33:32
AB              01            2011/9/23  03:33:01
AB              02            2011/9/25  01:34:30

³Ì²×­×§ï®É¶¡¬°¤l¸ê®Æ§¨ªº®É¶¡¡A½Ð¯q¦p¦ó­×§ïµ{¦¡½X?

Sub TEST()
    Dim fs, f
    Dim i As Integer
   
    Sheets("TEST").Activate
    Range("A1:C65536").ClearContents
   
    Set fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\TEST")
      For Each f In fs.SubFolders
          i = i + 1
          Cells(i, 1).Resize(1, 2) = Array(f.Name, f.DateLastModified)
      Next
End Sub

«ÜÁÂÁ¤j®aªºÀ°¦£^__^
¤p«Ä

¥»©«³Ì«á¥Ñ GBKEE ©ó 2011-9-28 15:24 ½s¿è

¦^´_ 1# child
  1. Option Explicit
  2. Dim i As Integer
  3. Sub Ex()
  4.     Dim Fs, F
  5.     Sheets(1).Activate
  6.     Range("A1:C65536").ClearContents
  7.     i = 1
  8.     Set Fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\TEST")
  9.     Cells(i, 1).Resize(1, 2) = Array(Fs, Fs.DateLastModified)
  10.     For Each F In Fs.SubFolders
  11.          i = i + 1
  12.         Cells(i, 1).Resize(1, 2) = Array(F, F.DateLastModified)
  13.         ¤l¸ê®Æ§¨ F
  14.     Next
  15. End Sub
  16. Private Sub ¤l¸ê®Æ§¨(TheFolder)
  17.     Dim Fs As Object, F As Object
  18.     Set Fs = CreateObject("Scripting.FileSystemObject").GetFolder(TheFolder)
  19.     For Each F In Fs.SubFolders
  20.         i = i + 1
  21.         Cells(i, 1).Resize(1, 2) = Array(F, F.DateLastModified)
  22.         ¤l¸ê®Æ§¨ F
  23.     Next
  24. End Sub
½Æ»s¥N½X

TOP

  1. Public r As Integer

  2. Sub À°§Ú°µ()
  3.    
  4.     Dim r As Integer
  5.     Dim fs As New FileSystemObject
  6.     Dim myfolder As Folder
  7.     Set myfolder = fs.GetFolder("D:\TEST")
  8.    
  9.     r = 0

  10.     ¦C¥X¸ê®Æ§¨ myfolder

  11. End Sub


  12. Sub ¦C¥X¸ê®Æ§¨(fd As Folder)

  13.     Dim f As File
  14.     Dim sfd As Folder
  15.    
  16.     For Each sfd In fd.SubFolders
  17.         For Each f In sfd.Files
  18.             r = r + 1
  19.             Cells(r, "A") = Split(fd, "\")(2)
  20.             Cells(r, "B") = Split(sfd, "\")(3)
  21.             Cells(r, "C") = f.Name
  22.             Cells(r, "D") = f.DateLastModified
  23.         Next
  24.         ¦C¥X¸ê®Æ§¨ sfd
  25.     Next

  26. End Sub
½Æ»s¥N½X
diabo

TOP

¦^´_  child
GBKEE µoªí©ó 2011-9-28 15:12



    ÁÂÁÂGBKEEª©¥DªºÀ°¦£^__^
¤p«Ä

TOP

diabo µoªí©ó 2011-9-28 15:13



       ¤]ÁÂÁÂdiabo ªºÀ°¦£^__^
¤p«Ä

TOP

DEAR.  

¥i¦A¥[¤J,,,³Ì²×¸ê®Æ§¨¤§Àɮ׼ƶq ???


³Â·Ð..

TOP

¦^´_ 6# tomking
  1. Sub Ex()
  2.     Dim Fs
  3.     Sheets(1).Activate
  4.     Range("A1:C65536").ClearContents
  5.     i = 1
  6.     Set Fs = CreateObject("Scripting.FileSystemObject").GetFolder("D:\test")
  7.     Cells(i, 1).Resize(1, 3) = Array(Fs, Fs.DateLastModified, Fs.Files.Count)
  8.     ¤l¸ê®Æ§¨ Fs
  9. End Sub
  10. Private Sub ¤l¸ê®Æ§¨(TheFolder)
  11.     Dim Fs As Object, F As Object
  12.     Set Fs = CreateObject("Scripting.FileSystemObject").GetFolder(TheFolder)
  13.     For Each F In Fs.SubFolders
  14.         i = i + 1
  15.         Cells(i, 1).Resize(1, 3) = Array(F, F.DateLastModified, F.Files.Count)
  16.         ¤l¸ê®Æ§¨ F
  17.     Next
  18. End Sub
½Æ»s¥N½X

TOP

·PÁÂ, ª©¥D,À°¦£...   

·P®¦

TOP

        ÀR«ä¦Û¦b : ¡i®É¶¡¦¨´N¤@¤Á¡j®É¶¡¥i¥H³y´N¤H®æ¡A¥i¥H¦¨´N¨Æ·~¡A¤]¥i¥HÀx¿n¥\¼w¡C
ªð¦^¦Cªí ¤W¤@¥DÃD