dates to end of month

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

I am looking for a formula that calculates the number of (working) days between today and the end of the current month
 
Hello

This VBA code will return the number of days remaining, not including today

Day = DatePart("d", Date()
FirstInMonth = DateAdd("d", 1-Day, Date()
NextMonth = DateAdd("m", 1, FirstInMonth
DaysLeft = DateDiff("d", Date(), NextMonth) -

It is also possible to write this in one big line

DateDiff("d", Date(), DateAdd("m", 1, DateAdd("d", 1-DatePart("d", Date()), Date()))) - 1
 

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