Dear Peter,
Sorry for the delayed response, but this is what i came up with.
If you select a date from an excisting sheet you will be directed to that sheet (the old functionality).
If you select a date from a non-excisting sheet you will be prompted wether you want to make a new sheet. Incase you selected a wrong date you can cancel at this point by clicking No.
Else the Template-sheet will be copied and renamed to the selected date.
The only thing you have to do before running this is that you have to locate the Change_Sheet sub in the calenderform and change the sheetname next to SheetToCopy.
P.s.
You will also notice that i've made some other changes to the original code.
Instead of repeating the same code 42 times for each button i have made one mastercode (Change_Sheet) which recieves an argument x.
In each Click-event from all buttons you refer to this mastercode and pass the argument.
The main advantages of this method are first of all you save a lot of lines of code and secondly if you make a change that applies to all buttons you only make the change in the mastercode instead of changing it 42 times.




Reply With Quote

Bookmarks