Get file names from a folder using Excel VBA

MP

Get name of the files in a folder

This is an Excel 2007 or later macro that can fetch the name of all the files in a folder.
  1. Download the file and open in Excel 2007 or later. If the macro security is not set to Low, you will be asked to Enable macros. Go ahead and enable the Macros.
  2. Click the button labelled "Get File Names from a folder"
  3. A warning message will pop up saying that the existing data in sheet 1 will be deleted. Click OK
  4. A dialog will open allowing you to browse the folder where your files are.
  5. Click OK and there you go!!


Get name of the pdf documents and number of pages

There is second macro which allows you to get the names of all the pdf files in a folder and the number of pages in each pdf. This has been specially helpful which I have to order prints, easy to count total number of pages.
  1. Click the button labelled "Get file names and number of pages in the pdf documents"
  2. A warning message will pop up saying that the existing data in sheet 1 will be deleted. Click OK
  3. A dialog will open allowing you to browse the folder where your files are.
  4. Click OK and there you go!!
If you find any bug in the code or if you need it in Excel 2003 format, post it in the comments below I will try to help you out!!
Feel free to use the VBA code to suit your needs.
(Note: An Excel macro in general should not create any problem with your MS Excel installations and other Add-Ins. If it does, use it at your own risk) 


Cheers!
Smile and Live Happy!



0 comments:

Post a Comment

 
Design by Wordpress Theme | Bloggerized by Free Blogger Templates | JCPenney Coupons