ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Discussion (Misc queries) (https://www.excelbanter.com/excel-discussion-misc-queries/)
-   -   how to return a date (https://www.excelbanter.com/excel-discussion-misc-queries/255897-how-return-date.html)

Jack Sons

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



Jim Thomlinson

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


.


Jack Sons

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


.





All times are GMT +1. The time now is 10:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
ExcelBanter.com