I need a formula or a VBA code to extract a date into a string. Could
you shed a light?
Thanks in advance.
I need a formula or a VBA code to extract a date into a string. Could
you shed a light?
Thanks in advance.
Perhaps something like this:
For a date in A1
B1: =TEXT(A1,"mmddyy")
You might also be able to just use a custom number format
Select A1
<format><cells><number tab>
Category: Custom
Type: mmddyy
Click the [OK] button
Is that something you can work with?
***********
Regards,
Ron
XL2002, WinXP
"Who I Am" wrote:
> I need a formula or a VBA code to extract a date into a string. Could
> you shed a light?
>
> Thanks in advance.
>
>
Or, try:
replace(yourDateVaraibleOrvalue,"/","")
=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)
=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)
oops, double post
This formula will give you mmddyy as text as long as excel recognizes
it as a date regardless of format. Even if it's formatted as a number,
general etc.
=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks