Dave,
Yes and no. What I need is the following.
The content of Cells(rijrij, kolkol) is like
Tiele
SHAD.-04-06
06 mei 2010
~gedaagde uitstel
but the format of lines 3 and 4 can differ
1) the first line has no fixed number of characters - it's a name +space
+ char(10),
2) the second line has always the same format (11 characters + space +
char(10)
3) the third line with the date (any date) could also be
06 mei 2010 vonnis
which is a date followed by 3 spaces and the word "vonnis", in this
case there is no fourth line,
if the word "vonnis" is not there the fourth line does exist
4) if the fourth line exists it will always start with ~ followed by 5 to
25 characters
I have a variable D that should be the date in line 3 because I need it in
If DateValue(D) < Date Then
That's all, it should be easy, but I messed around terribly, see the messy
code below the dotted line.
Can you show me the code I need?
Jack.
------------------------------------------------------------------------------------------------------
'til = InStr(1, Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), "~",
vbBinaryCompare)
'D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13, 100)
'D = Replace(D, " vonnis", "")
'LLL = Len(D)
'If D <> "" Then
'If Cells(rijrij, kolkol).Value Like "*~*" Then
'tiltil = InStr(1, D, "~", vbBinaryCompare)
'W = LLL - tiltil
'D = Mid(D, 1, W - 3)
'D = Replace(D, "~*", "")
'lang = Len(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)) - 9)
'D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13, 100)
'Else
'D = Mid(Range(Cells(rijrij, kolkol), Cells(rijrij, kolkol)), N + 13, til -
N - 13)
'End If
'End If