Thread: Date Variable
View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Franz E Franz E is offline
external usenet poster
 
Posts: 3
Default Date Variable

Hi, use this code instead:

curmt = Format(Date, "mmm-yyyy")
curmth = CDbl(CDate(curmt))
MsgBox curmth


"Ranjith Kurian" wrote:

Hi

I have one problem with the below code, it showing me the march 9th date,
how will i change it to 1st of every month, so that next month when i run
this it should show me 1st of April.

curmt = Format(Date, "mmm-yy")
curmth = CDbl(CDate(curmt))
MsgBox curmth

Answer is 39881, the required answer is 39873