Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 30
Default Extract Date (04/05/06) into Text (040506)

I need a formula or a VBA code to extract a date into a string. Could
you shed a light?

Thanks in advance.

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 2,118
Default Extract Date (04/05/06) into Text (040506)

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.


  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Extract Date (04/05/06) into Text (040506)

Or, try:

replace(yourDateVaraibleOrvalue,"/","")



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Extract Date (04/05/06) into Text (040506)

=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Extract Date (04/05/06) into Text (040506)

=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)



  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Extract Date (04/05/06) into Text (040506)


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.

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 360
Default Extract Date (04/05/06) into Text (040506)

=LEFT((TEXT(A1,"MM/DD/YY")),2)&MID((TEXT(A1,"MM/DD/YY")),4,2)&RIGHT((TEXT(A1,"MM/DD/YY")),2)

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
refer a cell text in b1 and extract remaing text from a1 Narnimar Excel Discussion (Misc queries) 4 April 3rd 10 12:30 PM
how to Extract the date or text from the whole column Arun.fpg Excel Discussion (Misc queries) 2 April 24th 09 03:46 AM
extract date from text Woodi2 Excel Worksheet Functions 19 December 1st 08 11:19 PM
How do I extract a date as text not the 1900 reference number Adam Excel Discussion (Misc queries) 3 March 23rd 05 05:04 PM
EXTRACT TEXT FROM A DATE Ronbo Excel Worksheet Functions 5 February 1st 05 07:39 AM


All times are GMT +1. The time now is 07:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright ©2004-2025 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"