Looking a macro to del all CSV files on my desktop, desktop folders and and its subfolders only
Thanks if anyone can assist
Looking a macro to del all CSV files on my desktop, desktop folders and and its subfolders only
Thanks if anyone can assist
Hello
Try this code
Please Login or Register to view this content.
< ----- Please click the little star * next to add reputation if my post helps you
Visit Forum : From Here
Hello Yasser,
Your code does not prevent searching system folders on the desktop. Folders like "Computer", "Documents", etc. This code will.
Please Login or Register to view this content.
Sincerely,
Leith Ross
Remember To Do the Following....
1. Use code tags. Place [CODE] before the first line of code and [/CODE] after the last line of code.2. Thank those who have helped you by clicking the Star below the post.3. Please mark your post [SOLVED] if it has been answered satisfactorily.
Old Scottish Proverb...
Luathaid gu deanamh maille! (Rushing causes delays!)
Thanks a lot Mr. Leith for the code
I tested it and got error 91 at this line
Please Login or Register to view this content.
Hello Yasser,
Sorry, I made a typo. oFile should be oFolder. This is the corrected code...
Please Login or Register to view this content.
Now it is perfect and awesome Mr. Leith
God bless you and my kind regards for you
Hello Yasser,
Thank you for catching my mistake.
While the File Scripting Object does a lot of functions well, there are somethings it can not do. The Shell object is a bit more complicated but has very few limitations when handling files and folders.
Hi Leith
Nice piece of code , pretty fast for 1000 csv files here and there on desktop
Save me from a weekly tedious task, thank you for effort and time
But last question what line should I change instead of desktop but my documents
Hello JEAN1972,
Here is the revised Module code. You have two choices. You can either use the added constant MyDocuments or use the folder picker. Both options are included.
Delete all code in the existing VBA Module and replace it with the code here.
Option 1Please Login or Register to view this content.
Option 2Please Login or Register to view this content.
Please Login or Register to view this content.
Thank you Leith
Works a charm
Hello JEAN1072,
You're welcome.
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks