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

¸ô®|¤U´M§äÀɮרíקï¦WºÙ

¸ô®|¤U´M§äÀɮרíקï¦WºÙ

¤U­±¬O§Ú¼gªº³¡¤À
§Æ±æ¦b¶}±ÒexcelÀɮ׫á´N¥i¦Û°Ê·j´M¸ô®|¤UÀɮצWºÙ¬°*Daily*ªºÀÉ®×,¨Ã¦Û°Ê­×§ïÄÒ¦W¬°AAA,
¦ý¸Õ¤F¤§«á¥H¥u¦³¿ù»~°T®§¥X²{,³Â·ÐÀ°À°§Ú³o­Óªì¾ÇªÌ

Private Sub workbook_open()

With Application.FileSearch
    .NewSearch
    .LookIn = "\\nas\aa"               '¦b³o­Ó¸ô³w¸Ì´M§ä
    .Filename = "Daily"              '´M§äªºÀɦW
    .MatchTextExactly = False         '¦r¦ê¤£»Ý§¹¥þ²Å¦X
    .FileType = msoFileTypeAllFiles   'Àɮ׫¬ºA¤£­­
    .SearchSubFolders = True          '¦b¤l¥Ø¿ý¸Ì¤]­n§ä
   
    If .Execute > 0 Then
      
        For i = 1 To .FoundFiles.Count
            
            Worksheets("sheet1").Cells(i, 1) = .FoundFiles(i)
        Next i
   
    End If

End With

End Sub
POP

¦^´_ 1# smartpearl

application.filesearch ¦boffice 2007 ¤w¸g°h§Ð, ¥i¥H¥ÎDIRªº¤èªk
´«ÀɦW¥i¥Î NAME ... AS ... ªº¤èªk

  1. Sub test()
  2.     Dim sFolder As String, sSearch As String
  3.     Dim sTemp As String
  4.    
  5.     sFolder = "\\nas\aa\"
  6.     sSearch = "*daily*"
  7.    
  8.     sTemp = Dir(sFolder & sSearch)
  9.    
  10.     Do While sTemp <> ""
  11.         Name sFolder & sTemp As sFolder & Replace(sTemp, "daily", "AAA", 1, -1, vbTextCompare)
  12.         sTemp = Dir
  13.     Loop
  14. End Sub
½Æ»s¥N½X
À´±oµo°Ý,µª®×´N·|¦b¨ä¤¤

¤µ¤éの¤@¬íは  ©ú¤éにない
http://kimbalko-chi.blogspot.com
http://kimbalko.blogspot.com

TOP

        ÀR«ä¦Û¦b : ¤H­nª¾ºÖ¡B±¤ºÖ¡B¦A³yºÖ¡C
ªð¦^¦Cªí ¤W¤@¥DÃD