#1   Report Post  
Posted to microsoft.public.excel.programming
hme hme is offline
external usenet poster
 
Posts: 1
Default Range split


Hi

Somebody help me

how can I copy dd, mm and yy from a text "dd/mm/yy" to 3 separat
cells.

thanks and regards
HM

--
hm
-----------------------------------------------------------------------
hme's Profile: http://www.excelforum.com/member.php...fo&userid=1593
View this thread: http://www.excelforum.com/showthread.php?threadid=32002

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,272
Default Range split

Without code

=DAY(A1)
=MONTH(A1)
=YEAR(A1)

--

HTH

RP
(remove nothere from the email address if mailing direct)


"hme" wrote in message
...

Hi

Somebody help me

how can I copy dd, mm and yy from a text "dd/mm/yy" to 3 separate
cells.

thanks and regards
HME


--
hme
------------------------------------------------------------------------
hme's Profile:

http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=320024



  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 74
Default Range split

cell C6 has string 11/12/04

any cell type
=LEFT(C6,2)
gives11
another cell type
=MID(C6,4,2)
gives 12
yet another cell type
=RIGHT(C6,2)
gives 04

is this what you want

==========
hme wrote in message
...

Hi

Somebody help me

how can I copy dd, mm and yy from a text "dd/mm/yy" to 3 separate
cells.

thanks and regards
HME


--
hme
------------------------------------------------------------------------
hme's Profile:

http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=320024



  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,236
Default Range split

If your date is in cell A1:
=DAY(A1)
=MONTH(A1)
=YEAR(A1)

or by vba:

Sub test()
Dim str As String, dtm As Date

'example 1
str = "13/01/04"

Debug.Print Left(str, 2)
Debug.Print Mid(str, 4, 2)
Debug.Print Right(str, 2)

'example 2
dtm = str
Debug.Print Day(dtm)
Debug.Print Month(dtm)
Debug.Print Year(dtm)
End Sub


--
Rob van Gelder - http://www.vangelder.co.nz/excel


"hme" wrote in message
...

Hi

Somebody help me

how can I copy dd, mm and yy from a text "dd/mm/yy" to 3 separate
cells.

thanks and regards
HME


--
hme
------------------------------------------------------------------------
hme's Profile:
http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=320024



  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 400
Default Range split

You could type the following directly into the target cells:

=day(A1)
=month(A1)
=year(A1)

Note: A1 contains a date .

This is sensitive to the short date setting in regional settings. Or, use
the following with VBA.

Format("yourdate","dd")
Format("yourdate","mm")
Format("yourdate","yyyy")


"hme" wrote:


Hi

Somebody help me

how can I copy dd, mm and yy from a text "dd/mm/yy" to 3 separate
cells.

thanks and regards
HME


--
hme
------------------------------------------------------------------------
hme's Profile: http://www.excelforum.com/member.php...o&userid=15930
View this thread: http://www.excelforum.com/showthread...hreadid=320024


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
Cell Range Split into Multiple Cells Willie Excel Worksheet Functions 6 January 3rd 12 09:09 PM
Split Cell Range into Multiple Cells Willie Excel Discussion (Misc queries) 2 December 2nd 11 01:48 AM
Copying a split range Horatio J. Bilge, Jr. Excel Discussion (Misc queries) 3 January 27th 09 11:05 PM
DGET Function - using a split criteria range? (Excel 2007) MikeT Excel Worksheet Functions 0 August 11th 08 10:37 PM
How do I remove split a split window? Norm New Users to Excel 3 July 19th 08 10:31 PM


All times are GMT +1. The time now is 08:56 AM.

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

About Us

"It's about Microsoft Excel"