[vba] How do I format a date in VBA with an abbreviated month?

The code I am using is:

Format(now(), "MMMM dd, yyyy") 

This code returns something like the following:

March 10, 2013

How do I modify the date format code to output the abbreviated month as shown below?

Mar 10, 2013

This question is related to vba date

The answer is


I'm using

Sheet1.Range("E2", "E3000").NumberFormat = "dd/mm/yyyy hh:mm:ss"

to format a column

So I guess

Sheet1.Range("E2", "E3000").NumberFormat = "MMM dd yyyy"

would do the trick for you.

More: NumberFormat function.


Use this:

Format(Now, "MMMM dd, yyyy")

More: Format Function