date format

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
 
B

Bob Phillips

Try

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

HTH

Bob
 
H

Harald Staff

Hi Remi

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

HTH. Best wishes Harald
 

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

Top