See if this helps
Formula:
=DAY(DATE(E2,MONTH(DATEVALUE("1/"&D2&"/"&E2))+1,1)-1)
Where D2 = Month as string
E2 contains the year, this is needed to handle leap years.
Or, if you are only interested in the current year, adapt the formula as Martin suggests
Formula:
=DAY(DATE(YEAR(TODAY()),MONTH(DATEVALUE("1/"&D5&"/"&YEAR(TODAY())))+1,1)-1)
This doesn't involve the Analysis ToolPak add-in. with 2003 and earlier
Bookmarks