ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   R: Alternate ways to extract a substring? (https://www.excelbanter.com/excel-programming/444449-r-alternate-ways-extract-substring.html)

r[_4_]

R: Alternate ways to extract a substring?
 
Hi Robert

Function Mid2( _
sString As String, _
lStart As Long, _
Optional lLength As Long) As String

Mid2 = Right(sString, Len(sString) + 1 - lStart)
If lLength Len(Mid2) Then
Mid2 = Left(Mid2, lLength)
End If
End Function


regards
r


All times are GMT +1. The time now is 11:54 PM.

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