Forum Moderators: open
Function ExtractCR(stemp As String) As String
Dim lPosofEnterinText As Long
Dim stemp1 As String
'---------------------- Look for a carriage return in the Text
lPosofEnterinText = InStr(1, stemp, Chr(10), vbTextCompare)
If lPosofEnterinText <> 0 Then
stemp = Mid$(stemp, 1, lPosofEnterinText - 1)
End If
lPosofEnterinText = InStr(1, stemp, Chr(13), vbTextCompare)
If lPosofEnterinText <> 0 Then
stemp = Mid$(stemp, 1, lPosofEnterinText - 1)
End If
ExtractCR = stemp
End Function
What am I doing wrong? Can anyone help?
Thanks.