Difference makes the DIFFERENCE
Categorised Menu List
Displays file names of a selected folder
When the code is copied and pasted on to code window, please be aware that they are copied as smart quotes (as in Ms.Word or any other rich text editors), so replace them with double quotes in the code window again.
All the content that you learn here will not be of any use, until you practice, so I urge you to practice. As and when you practice, you get more doubts as to how to go ahead, these doubts strengthen your knowledge and lead you to experience.
Practice those examples that I have placed under the content header Content for Assistance. These will be helpful in day-to-day activities.
The following code is written in Microsoft Excel.
Useful to list files from specified folder, including sub folders., into current spreadsheet.
The following Code retrieves the files from the selected location of your hard disk into the current spread sheet.
Advantage: You need not browse through all the folders and sub folders to know the contents of the folder.
If the computer displays a message saying: Macro Level set too HIGH, Click "Enable Macros" button.
Files are displayed in the spread sheet and also a message box is displayed with the retrieved file count.
a brief description : This code will help to extract files path from a particular folder.
For example: if there exists a folder "C:\Repath\ExcelFiles\", this folder has many files and sub folders. The path of each file is be listed, including sub-folders. This code will help to retrieve the file(s) path into current worksheet. The output would look like:
c:\Repath\ExcelFiles\abc.txt
c:\Repath\ExcelFiles\abcd.exe
c:\Repath\ExcelFiles\sample.xlsx
c:\Repath\ExcelFiles\Client\Jan.doc