Hello All,
I am trying to create a VBA in Excel that replicates a cmd script to list out contents of a folder, subfolders and files, and found this piece of code from an earlier post dated Dec 13, 2018:
The code in the link works perfectly fine, but has one minor short coming.
Each time we try to browse through the contents of a folder, we need to copy the folder path, go to the code module manually and and then paste the same in the code.
Was just wondering if there is a way if this process could be automated either by usung Folder Picker dialogue box [ Application.FileDialog(msoFileDialogFolderPicker) ] or copying the address of the folder and pasting it in a particular cell (example A2) and then automating the code to fetch the path from the designated cell (A2, as in the example), and display the contents.
I am a novice in the field of excel VBA and tried my hand to make some changes to the existing code, but that did not materialise.
Your assistance in this regard shall be of immense help!
Thanks for your valuable time & efforts in advance.
I am trying to create a VBA in Excel that replicates a cmd script to list out contents of a folder, subfolders and files, and found this piece of code from an earlier post dated Dec 13, 2018:
VBA to List all Folders, Subfolders and files in a directory
Hi all, I found many examples that prints file directories into a spreadsheet. I am trying to create a VBA in Excel that replicates a cmd script to list out contents of a folder, subfolders and files tree "C:\list\" > C:\list\details.txt" /A /F The spreadsheet needs to cascade so column A...
www.mrexcel.com
The code in the link works perfectly fine, but has one minor short coming.
Each time we try to browse through the contents of a folder, we need to copy the folder path, go to the code module manually and and then paste the same in the code.
Was just wondering if there is a way if this process could be automated either by usung Folder Picker dialogue box [ Application.FileDialog(msoFileDialogFolderPicker) ] or copying the address of the folder and pasting it in a particular cell (example A2) and then automating the code to fetch the path from the designated cell (A2, as in the example), and display the contents.
I am a novice in the field of excel VBA and tried my hand to make some changes to the existing code, but that did not materialise.
Your assistance in this regard shall be of immense help!
Thanks for your valuable time & efforts in advance.