How to create date format in vba

E

Eric

Hi there,

Can anyone help me please on how to create a date format
in this sample format, I want to write in macro that
automatically substitute them in my reports.

I want this format: "Tuesday, November, 25, 2003".

Can anybody help me please.

TIA
Eric
 
D

Don Guillett

try
Sub formatit()
' "Tuesday, November, 25, 2003".
Selection = Format(Selection, "dddd dd,yyyy")
End Sub
 
T

Tom Ogilvy

ActiveCell. NumberFormat = "dddd, mmmm, d, yyyy"

from the immediate window:

ActiveCell.Value = date
ActiveCell. NumberFormat = "dddd, mmmm, d, yyyy"
? activecell.Text
Tuesday, November, 25, 2003
 
C

Christine Flott

Eric,

If you go to Format-->Cells and choose a custom format, you can use
this to get that result:

dddd, mmmm, d, yyyy

You can then apply that format to the other cells in your spreadsheet
that contain dates.

Hope this helps.
Christine Flott
 

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