I'm writing a macro to find out if a given month/year falls within a date range.
The spreadsheet has 2 columns (3 and 4) which hold a start date and stop date. The macro needs to cycle through each month of the year (over 3 years) and count the rows that the given month falls within the date range
The row gets counted even if it's only for 1 day.
Example, if start date is 1/31/06, it would still get counted when checking for rows in the month of January 2006, same goes for stop dates.
This is the code I have now:
The stop date might be blank (if the job is still outstanding), so I just assigned it todays date since the macro only checks up through the previous month.
The Month and Year variables are used to place the results in a table correctly.
I'm wondering if I have my IF statement correct to validate if the date range falls within the given month. I'd try to validate it using just a specific month/year, but there's thousands of rows, so manual counting is not an option and if my IF statement is incorrect, then I can't write macro to check just a single month.
Maybe there's an easier function that can do this?
Anyone have any suggestions?
Bookmarks