I'm working in vba for excel and need the use of a function that I can input a date that is in the format of the excel converted date (such as 40736). And output the date of the quarter immediately following the input date in the format yyymmdd, where the quarters are Jan 1, Apr 1, Jul 1, and Oct 1. All calculations need to be done in vba, not in the worksheet. As an example: my input might be 40736 (the excel date that corresponds with 7/12/2011. I'd like my output to be 20111001, which corresponds with the following quarter.
I'm really not sure how to even approach this so any help with strategies or proposed peices of code would be great. Thanks