you may need to adjust the vbLf constant, depending on the values that force the new line
vbLf is the LineFeed character, chr(10)
vbCR is the Carrage Return character, chr(13)
vbCrLf is both combined into one
These selections cover 95% of the cases.
Create a UDF function:
Code:
Function GetLine(data As String, n As Long)
GetLine = Split(data, vbLf)(n - 1) 'subtract 1, as array from the Split function are
'zero based, and most people count lines from 1
End Function
and call using =GetLine(A1,2) as the formula to get the second line from the cell A1
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.