I am new in excel VBA, I am looking for an Excel VBA code that will delete all the outlook email files (.msg) saved in local windows folder using 2 conditions and keep the last dated email file. The email files are from different suppliers that supply cement, steel and other construction materials. Each materials have multiple number of suppliers. For example, the first condition is to loop in the folder all the email files that contains a word "Cement" (located in middle of filename) and "Supplier A"(located in the last of the filename next to .msg). Second condition is to delete all the previous dated email and keep the last dated email from the selected files in the first condition e.g. if there are 4 emails found with words in the filename containing "Cement" and "Supplier A", it will delete the 3 previous email and keep the last dated email. I am using cell reference for materials and supplier, the material "Cement" is link in cell A1 and the "Supplier A" is link in cell A2. Appreciate any help, thanks.