Dear Master Vba,
 

 Terlampir File untuk mencari Alamat File (Path).
 Yang Saya butuhkan, yaitu saat NEXT ke kolom berikutnya (B6) tanpa menimpa 
kolom sebelumnya. Mohon dibantu koreksi scriptnya berikut:
 

 

 Sub Subfoldersandfolders()
 Dim FSO As Object
 Dim FSOFolder As Object
 Dim Objfile As Object
 Dim subfd As Object
 Dim x As String
 

 

 

 

 Application.FileDialog(msoFileDialogFolderPicker).Show
 x = Application.FileDialog(msoFileDialogFolderPicker).SelectedItems(1)
 Set FSO = CreateObject("Scripting.FileSystemObject")
 i = 3
 Set FSOFolder = FSO.GetFolder(x)
 

 'Lis File in Folders
 For Each Objfile In FSOFolder.Files
 'Cells(i, 1) = Objfile.Name
 Cells(i, 2) = Objfile.Path
 i = i + 1
 Next
 

 'Lis File in SubFolders
 For Each subfd In FSOFolder.SubFolders
 For Each Objfile In subfd.Files.Count
 'Cells(i, 1) = Objfile.Count
 Cells(i, 2) = Objfile.Path
 i = i + 1
 Next
 Next
 End Sub
 

 

 

 Terimakasih
 

 

 

 

 Regards,
 Roni

Attachment: PATH.xlsb
Description: application/vnd.ms-excel.sheet.binary.macroenabled.12

  • [belajar-excel] M... y.ron...@yahoo.com [belajar-excel]

Kirim email ke