View Single Post
 
Old 01-17-2021, 04:07 PM
Guessed's Avatar
Guessed Guessed is offline Windows 10 Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,980
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

Paul has done a good job which but there would be a simpler way that cuts down on the code looping through subfolders.

There are shell (command prompt) commands that can do the iterative deletion more simply. Refer to Recursively Delete a Specific File Type from all Subfolders | SumTips for an example of one line deleting all files in subfolders.

Running Shell commands in VBA https://www.myonlinetraininghub.com/...mand%20Prompt.

You would most likely still want Paul's folder selection code.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote