Reputation: 11
My start and end dates will continually change. I need the appropriate cells to highlight the appropriate range between the start and end dates. Each column will have a date heading. The dates will be a month and year and run for a year. For example, Jan 15, Feb 15, Mar 15......Jan 16. How should I write this formula?
Thanks for your help in advance.
If my image does not post, the excel sheet will look like:
|Supervisors|Job Number|Start date|End Date|Jan-15|Feb-15|Mar-15...
| John Doe |12345-67 | Jan 15 |June 15 |xxxxx |xxxxx |xxxxx
Upvotes: 0
Views: 1873
Reputation: 25
Just to clarify the question, you want to put in one heading for each month between the start and end date?
You can use the MONTH() function to extract the month from a date. So using VBA, you could do something like
for index = 0 to (month(enddate) - month(startdate)) 'Insert a header next index
You can do the same with year if they are not all in the same year.
Upvotes: 1