There must be something wrong with the way you are entering the dates. OR the date formats must be wrong, the code looks at 3 conditions
if the date difference is above or equal to 0 (Zero) AND the date difference is below or equal to 7
OR the date difference is below 0 (Zero)
It will not do anything if the difference is outside of these conditions
please update the file you are working on so I can check the dates as without seeing it I cannot explain what is happening, I have tested it on my machine and it works correctly.
So from the attached workbook, the date difference between today and the dates are below. From the code I have written, only one email should be generated and that would be for the -10 row.
For me this is exactly what is happening, only one email is being generated.
Can you go into control panel
Click on 'Clock, Language and Region settings'
Click 'region and Language'
Please check what Format is selected. I have "English United Kingdom" perhaps you have another switch switches your month and date around?
I have created a task scheduler to run everyday at 4 PM,.. and observed that the task is just opened the workbook.. & then i need to enable the macro to run..
How to avoid this manual work..
Requirement: I have a macro in excel which needs to be run once a day and I don't even want to open the excel sheet. How can I make this process automatic?
A forum community dedicated to tech experts and enthusiasts. Come join the discussion about articles, computer security, Mac, Microsoft, Linux, hardware, networking, gaming, reviews, accessories, and more!