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

[µo°Ý] ¤j¶qÀɦW¹ïÀ³­×§ï

[µo°Ý] ¤j¶qÀɦW¹ïÀ³­×§ï

¤j®a¦n
¥Ø«e°w¹ï¤j¶qÀɦW­×§ï
§Ú¤w¸g¥i¥H±N¯S©w¥Ø¿ý¤UªºÀɮצWºÙ§ì¨ìÄæ¦ìAÄ椺
¦Ó±µ¤U¨Ó¤H¤u±NBÄæ¦ì¹ïÀ³ªº·s¦WºÙ¶ñ¤J«á
»Ý­nÅýµ{¦¡¦Û¤v¥h­×§ïÀɮצWºÙ¬°·s¦WºÙ
·Q½Ð°Ý¤j®a³o¬O§_¦³¥i°Ñ¦Òªº¤è¦¡¨Ó³B²z
¦³ÂI§ì¤£µÛÀYºü
ÁÂÁÂ
  1. Sub listfiles()

  2. Dim oFSO As Object
  3. Dim oFolder As Object
  4. Dim oFile As Object
  5. Dim i As Integer


  6. Worksheets.Add().Name = "listfile"  'add new sheet and name to listfle

  7. Set oFSO = CreateObject("Scripting.FileSystemObject")


  8. Set oFolder = oFSO.GetFolder("D:\Desktop\New folder")

  9. Cells(1, 1) = "Existing File Name"
  10. Cells(1, 2) = "New File Name"


  11. i = 2


  12. For Each oFile In oFolder.Files

  13.     Cells(i, 1) = oFile.Name              'file name


  14.     i = i + 1

  15. Next oFile

  16. End Sub
½Æ»s¥N½X

¦b¤£¦Ò¼{¦³Â²Å餤¤å©Î¤é¤åÀɦW//
Old_Name = "¸ô®|\" & ­ìÀɦW.°ÆÀɦW
New_Name = "¸ô®|\" & ·sÀɦW.°ÆÀɦW
If Dir(Old_Name) <> "" Then Name Old_Name As New_Name

TOP

        ÀR«ä¦Û¦b : ¹ï¤÷¥À­nª¾®¦¡A·P®¦¡B³ø®¦¡C
ªð¦^¦Cªí ¤W¤@¥DÃD