Is there any VB command to find out the total no. of days in a month?

  • Thread starter Thread starter =?big5?B?qvykVA==?=
  • Start date Start date
Hi. "ªü¤T" . One common way is to look at the first day of next month,
but instead of using 1, use 0 to return the previous day.

dte = Int(Now)
NumDays = Day(DateSerial(Year(dte), Month(dte) + 1, 0))
' or with atpvbaen.xls loaded...
NumDays = Day(EOMONTH(dte, 0))
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top