Hi widodude,
There are lots of ways to put those dates across the top of your sheet. This one uses the date in B3 and fills them in to the end of the month. I find that VBA doesn't use the same Date formula syntax as Excel so I set formulas in the Excel cells to get what I wanted and then used those numbers in the VBA.
I'm sure one of the good gurus could make this code in about half the lines. Watersev could do it in about 3 using his codeing style.
See the attached with the code:
BTW - I hate dates across the top as column heads. I think you will be much better off putting all the dates in a single column. This way Excel can treat your data as a List/Table and do a lot more things with it. Perhaps if you show a real example of what you are intending, we can fix your data structure so it does a lot more.
Bookmarks