Here is a solution:
Your year and month will go in column B and the days in column C
In cell B2 enter "01-01-2009"
Format B2 with a custom format "yyyy"
In cell B3 enter =DATE(YEAR($B$2),"1","1")
note the $ signs
Format B3 with a custom format "mmmm"
Drag the formula in B3 down to B14
All the cells under 2009 will show January
Now edit each formula starting with B4, changing the month
B14 will contain =DATE(YEAR($B$2),"12","1")
In C3 enter the following formula =IF(NOW()>=B3,IF(MONTH(NOW())=MONTH(B3), DAY(NOW()),eomonth(B3,0)),"")
Format cell C3 with a custom format "dd"
Drag the formula in C3 down to C14
This is what my worksheet looks like:
PS if you try this in Excel 2003 and it doesn't work, you likely do not have the EOMONTH function installed
EOMONTH is end of month and gives the last day in a month (takes account of leap years)
To activate EOMONTH go to the tools menu - Add-Ins
Look for Analysis toolpack or Analysis toolpack - VBA and check one of them
Back on your worksheet hit f9.
AFAIK EOMONTH is standard in Excel 2007.