Thread: Calendar in VBA
View Single Post
  #2   Report Post  
Jason Morin
 
Posts: n/a
Default

The number of days in a month is affected by the year
(leap year), so with a formula use:

=EOMONTH((A1&"-"&C1)*1,0)-(A1&"-"&C1)*1+1

where A1 holds the month and C1 holds the year (like
2004).

If the formula returns the #NAME? error, install and load
the Analysis ToolPak add-in under Tools Add-Ins.

HTH
Jason
Atlanta, GA


-----Original Message-----
Hello,

Is it possible to design a VBA macro that would return

the number of days in
a specific month?
Ex. I'd input a month(December) and the VBA would return

(31).
Thanks,

.