date function

N

Newbie

Hi,

I want to be able to set a datepicker to a default date of
the monthend date 2months before the current month

I have tried
mDate = DateSerial(Year(date),Month(date) - 2, Day(0))

but this gives me

when Date = 17/11/03

mDate = 30/9/03

when Date = 17/12/03

mDate = 30/10/03 = . . . this should be 31/10/03

What am I doing wrong?
 

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

DateAdd 1
Problem formatting dates from CSV file 2
Set Date 1
Excel Vba to change displayed year automatically. 14
Default Date Value 1
I am trying to create a formula 2
Excel less than greater than formula 1
Date format. 1

Top