Last day of this Month

B

Bob Vance

What do I change to show the last day of the month we are in.......Thanks
Bob
tbDateTo.value = Format(DateSerial(Year(Date), Month(Date) 1, 0),
"dd-mmm-yyyy")
 
A

Allen Browne

Bob, you dropped a plus sign:
Me.tbDateTo = DateSerial(Year(Date), Month(Date) + 1, 0)

Assuming that tbDateTo is meant to be a date value, you don't want to use
Format() which would format it as a string.
 
A

Allen Browne

Bob Vance said:
Allen what would be 1st day of Next Month

In the VBA window, call up help on DateSerial() to see how it works.

Then see if it makes sense to change the last 0 in the expression to a 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

Similar Threads


Top