Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Get the Date

I need to know, how to read out the dates from the Line

A1: Report 01.06.2005 - 30.06.2005

Thanks

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 65
Default Get the Date

Put the following formula in B1

=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,(FIND(" ",A1,1)+1))-FIND(" ",A1,1))

and the subsequent formula in C1

=MID(A1,FIND(B1,A1,1)+LEN(B1)+2,LEN(A1)-FIND(B1,A1,1)+LEN(B1)+2)

It makes assumptions that cell A1 conistently follows the format you
indicated below.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Thomas" wrote:

I need to know, how to read out the dates from the Line

A1: Report 01.06.2005 - 30.06.2005

Thanks

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 107
Default Get the Date

Thank you a lot, but i have to do this via VBA.

Thomas

"galimi" wrote:

Put the following formula in B1

=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,(FIND(" ",A1,1)+1))-FIND(" ",A1,1))

and the subsequent formula in C1

=MID(A1,FIND(B1,A1,1)+LEN(B1)+2,LEN(A1)-FIND(B1,A1,1)+LEN(B1)+2)

It makes assumptions that cell A1 conistently follows the format you
indicated below.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Thomas" wrote:

I need to know, how to read out the dates from the Line

A1: Report 01.06.2005 - 30.06.2005

Thanks

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,120
Default Get the Date

Thomas,

Here is some code

Dim iPos1 As Long
Dim iPos2 As Long
Dim iPos3 As Long
Dim iPos4 As Long

With Range("A1")
iPos1 = InStr(1, .Value, " ")
If iPos1 0 Then
iPos2 = InStr(iPos1 + 1, .Value, " ")
If iPos2 0 Then
iPos3 = InStr(iPos2 + 1, .Value, " ")
If iPos3 0 Then
iPos4 = InStr(iPos3 + 1, .Value, " ")
If iPos4 < 1 Then
iPos4 = Len(.Value) + 1
End If
MsgBox CDate(Replace(Mid(.Value, iPos1 + 1, iPos2 - 1 -
iPos1), ".", "/"))
MsgBox CDate(Replace(Mid(.Value, iPos3 + 1, iPos4 - 1 -
iPos1), ".", "/"))
End If
End If
End If
End With


--
HTH

Bob Phillips

"Thomas" wrote in message
...
Thank you a lot, but i have to do this via VBA.

Thomas

"galimi" wrote:

Put the following formula in B1

=MID(A1,FIND(" ",A1,1)+1,FIND(" ",A1,(FIND(" ",A1,1)+1))-FIND(" ",A1,1))

and the subsequent formula in C1

=MID(A1,FIND(B1,A1,1)+LEN(B1)+2,LEN(A1)-FIND(B1,A1,1)+LEN(B1)+2)

It makes assumptions that cell A1 conistently follows the format you
indicated below.
--
http://HelpExcel.com
1-888-INGENIO
1-888-464-3646
x0197758


"Thomas" wrote:

I need to know, how to read out the dates from the Line

A1: Report 01.06.2005 - 30.06.2005

Thanks



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
Concatenate including a date so that the date appears as a date Zembu Excel Worksheet Functions 2 January 6th 10 06:09 PM
date in Cell to change colors if the date is beyond today's date Pete Elbert Excel Discussion (Misc queries) 2 June 6th 09 06:31 AM
Making a date go red, if date passes todays date. Jamie Excel Worksheet Functions 2 September 9th 08 02:14 PM
Report Date - Date Recv = Days Late, but how to rid completed date MS Questionnairess Excel Worksheet Functions 1 January 24th 07 11:05 PM
Date updates from worksheet to chart & changes date to a date series! Help!! Jayjg Charts and Charting in Excel 2 January 22nd 05 03:00 PM


All times are GMT +1. The time now is 07:53 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"