I need a vba code to do the following actions on multiple excel files in a specific directory:
1- when I run the code, a msgbox appears to select the directory where i have my excel files
2- then, I need the code to go through sheet2 in each file inside the directory and sub-directories to check if the date inside range1 is greater than 30/06/2015
3-if the date is greater than 30/06/2015, then clear this cell (not the row)
4-Go to range2 check if the date is greater than 30/06/2015, if true clear this cell
5- then, if the cells in range1 and range2 empty, make the corrosponding cell in range3 empty.
6- show msgbox of how many excel files were checked
I will need to do the same thing again, but the date would be 31/08/2015
I attached two files:
- the first is a sample of the excel files i will run the required code for.
the yellow shade area are the effected cells, column "N" represent range1, column "O" represent range2, and column "W" is range3.
if the date in cell "N11" and "O11" are greater than 30/06/2015, empty cell, otherwise keep information.
why i need this code? I need this to get the percentage of range 3 once before 30/06/2015 and another before 31/08/2015 and i will have to do the same things on multiple excel files.
-the second a code I downloaded from the internet to protect and unprotect multiple excel files and worked like a charm for me
I have seen the excel sheet you attached, basically you want to cleanup cells not meeting the criteria and based on that percentage cells will be cleaned up. I will give you a test run VBA