date format

  • Thread starter Thread starter Rémi
  • Start date Start date
R

Rémi

hello everybody,
i need to get the date format as follows : year and month in a cell
actually i'm using this code :
With Worksheets("feuil1")
.Range("D4") = Year(Date) & "." & Month(Date)
but i'd like to get the month as 01 for january / 02 for february / 03 for
march etc etc
does someone can help me please
thanks
Rémi
 
Try

With Worksheets("feuil1").Range("D4").
Value = Date
.NumberFormat = "yyyy mm"
End With

HTH

Bob
 
Hi Remi

..Range("D4").Value = "'" & Format(Date, "yyyy.mm")

HTH. Best wishes Harald
 
Back
Top