#1   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default how to return a date

Hi all,

I have these lines of code:

D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13,
100)
If D < "" Then
If DateValue(D) < Date Then

The content of Cells(rijrij, kolkol) was always like:
Brink
PN•M•–03–04
24 februari 2010

D resulted in a date (continental European notation), in this case 24
februari 2010. The second and third lines of coded worked like intended.

Now in some (not all) cases the content of Cells(rijrij, kolkol) is like:
Berg
PN•A•–05–06
18 februari 2010 vonnis

The difference is that in these cases after the date always comes the same "
vonnis".

How to distinguish between the case with and without " vonnis" and how to
extract the date (D) in the cases with " vonnis"?

Thanks in advance for your help.

Jack Sons
The Netherlands


  #2   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 5,939
Default how to return a date

Try this

D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13, 100)
D = Replace(D, " vonnis", "")

If D < "" Then

--
HTH...

Jim Thomlinson


"Jack Sons" wrote:

Hi all,

I have these lines of code:

D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13,
100)
If D < "" Then
If DateValue(D) < Date Then

The content of Cells(rijrij, kolkol) was always like:
Brink
PN€¢M€¢€“03€“04
24 februari 2010

D resulted in a date (continental European notation), in this case 24
februari 2010. The second and third lines of coded worked like intended.

Now in some (not all) cases the content of Cells(rijrij, kolkol) is like:
Berg
PN€¢A€¢€“05€“06
18 februari 2010 vonnis

The difference is that in these cases after the date always comes the same "
vonnis".

How to distinguish between the case with and without " vonnis" and how to
extract the date (D) in the cases with " vonnis"?

Thanks in advance for your help.

Jack Sons
The Netherlands


.

  #3   Report Post  
Posted to microsoft.public.excel.misc
external usenet poster
 
Posts: 144
Default how to return a date

So easy, works well, thanks Jim.

Jack.


"Jim Thomlinson" schreef in
bericht ...
Try this

D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13, 100)
D = Replace(D, " vonnis", "")

If D < "" Then

--
HTH...

Jim Thomlinson


"Jack Sons" wrote:

Hi all,

I have these lines of code:

D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13,
100)
If D < "" Then
If DateValue(D) < Date Then

The content of Cells(rijrij, kolkol) was always like:
Brink
PN.M.-03-04
24 februari 2010

D resulted in a date (continental European notation), in this case 24
februari 2010. The second and third lines of coded worked like intended.

Now in some (not all) cases the content of Cells(rijrij, kolkol) is
like:
Berg
PN.A.-05-06
18 februari 2010 vonnis

The difference is that in these cases after the date always comes the
same "
vonnis".

How to distinguish between the case with and without " vonnis" and how
to
extract the date (D) in the cases with " vonnis"?

Thanks in advance for your help.

Jack Sons
The Netherlands


.



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
Return date if in range, else return blank LisaL Excel Worksheet Functions 1 July 22nd 09 03:23 PM
return a date from range, date is between dates in two other cells NN Excel Discussion (Misc queries) 1 September 28th 06 10:05 PM
Date Function formula that will return the date of a specific week Greg Excel Worksheet Functions 4 June 12th 06 05:07 PM
Date formula: return Quarter and Fiscal Year of a date Rob Excel Discussion (Misc queries) 7 May 11th 05 08:48 PM
calc constant date from variable date & return with ability to rn. SusieQ'sQuest Excel Worksheet Functions 1 November 9th 04 08:51 PM


All times are GMT +1. The time now is 04:48 PM.

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"