PDA

View Full Version : Code to print folders, subfolders and files



khaledocom
03-16-2011, 03:40 AM
Hi all,

Is it possible to have a code that extracts the contents of My documents and desktop to one sheet as follows:

My documents
Subfolder-1
files ..
files ....
Subfolder-2
files ..
files ....
So on ..................

Then desktop contents as well.

After finish listing, save the worksheet in same excel file.

Please help.

Thanks in advance.

GTO
03-16-2011, 05:08 AM
See if the workbook at #11 helps:
http://www.vbaexpress.com/forum/showthread.php?t=36216

shrivallabha
03-16-2011, 05:12 AM
And also following KB entry if you are using Excel 2003 because .filesearch is not available in 2007 onwards versions.
http://www.vbaexpress.com/kb/getarticle.php?kb_id=837