hi,
I want help in developing the following code.

step1 : match Todays date with string in Paragraph.
Step 2: if Date matches, extract from Date to EndOfLine.

Step 1 code

If InStr(status_array(i), Format(Now(), "mm-dd-yyyy")) <> 0 Then
Step2 code

End If

Please help me developing code for Step2.

Regards,
Dinil

Recommended Answers

All 2 Replies

Dim iLoc as Integer
Dim tStr as Integer
iLoc = 0

iLoc = InStr(1, status_array(i), Format(Now(), "mm-dd-yyyy"))
tStr = ""
If  iLoc <> 0 Then
    tStr = Mid(status_array(i), iLoc, Len(status_array(i)) - (iLoc - 1))
    'tStr now holds the string extracte from Date to EndOfLine

'    If you want to omit the date then use this
'    tStr = Mid(status_array(i), iLoc+10, Len(status_array(i)) - (iLoc - 11))

End If

Hi,

Try This :

Dim j As Integer
Dim NewStr As String
j = InStr(status_array(i), Format(Now(), "mm-dd-yyyy"))
If j <> 0 Then
    NewStr = Mid(status_array(i), j)
End If

Regards
Veena

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.