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.
 
Top