Excel 2003 - VBA - Working with Dates

  • Thread starter Thread starter Craig Brandt
  • Start date Start date
C

Craig Brandt

Does anyone have and idea how to create the date of the last day of the
previous month?

Craig
 
Hi Craig

=Dateserial(year(date), month(date), 0)

HTH. Best wishes Harald
 
Assuming the OP actually needs this in VBA (as his Subject seems to
indicate), the VB equivalent of your worksheet formula is this...

LastDayOfPreviousMonth = Date - Day(Date)
 
Thanks for all your help. The entry showing the code for VBA nailed it.

Craig
 

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