Dates

R

Rick Rothstein \(MVP - VB\)

I want to format my date from 1/24/2006 to 1242006

In code
============
YourDate = "1/24/2006"
CodedDate = Format$(YourDate, "mddyyyy")

On the sheet
============
Select cell or column, right-click and select Format Cells, select Custom
from the Category list on the Number tab, and put mddyyyy in the Type field.

Rick
 
R

Ron Rosenfeld

I want to format my date from 1/24/2006 to 1242006

Thanks.

Why do you want to use an ambiguous format?

The format is mddyyyy

But how would you know, for example, if

1122006, which is the same format, represents

Jan 12, 2006 (1/12/2006) or
Nov 2, 2006 (11/2/2006)

???
--ron
 
R

Rick Rothstein \(MVP - VB\)

I want to format my date from 1/24/2006 to 1242006
Why do you want to use an ambiguous format?

The format is mddyyyy

But how would you know, for example, if

1122006, which is the same format, represents

Jan 12, 2006 (1/12/2006) or
Nov 2, 2006 (11/2/2006)

Won't the forced 2-digit day number control that? The last six digits are
always 2-digit day and 4-digit year... what ever is in front of that is the
month. Personally, if I had to do something like this, I would force the
month to 2 digits also.

Rick
 
R

Ron Rosenfeld

Won't the forced 2-digit day number control that? The last six digits are
always 2-digit day and 4-digit year... what ever is in front of that is the
month. Personally, if I had to do something like this, I would force the
month to 2 digits also.

Rick

Rick,

You are correct. I was using the mdyyyy format but wrote mddyyyy.

mea culpa

Thanks for pointing it out.
--ron
 
Top