ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   How to create date format in vba (https://www.excelbanter.com/excel-programming/283561-how-create-date-format-vba.html)

Eric[_6_]

How to create date format in vba
 
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


Don Guillett[_4_]

How to create date format in vba
 
try
Sub formatit()
' "Tuesday, November, 25, 2003".
Selection = Format(Selection, "dddd dd,yyyy")
End Sub


--
Don Guillett
SalesAid Software

"Eric" wrote in message
...
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




Tom Ogilvy

How to create date format in vba
 
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


--
Regards,
Tom Ogilvy

"Eric" wrote in message
...
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




Christine Flott[_2_]

How to create date format in vba
 
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

"Eric" wrote in message ...
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



All times are GMT +1. The time now is 06:07 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com