EXCEL LastIndexOf

Ilyen valamiért nincs, pedig néha hasznos lenne. Gondoltam írok egyet, mert miért ne, úgy is rég visual basic-eztem:

Function LastIndexOf(src As Range, char As String)
Dim value As String
Dim valueLen As Integer

value = src.Cells(1, 1).value
valueLen = Len(value)

For i = valueLen To 1 Step -1
If Mid(value, i - 1, 1) = Left(char, 1) Then
 LastIndexOf = i
 Exit Function
End If
Next i
End Function

Használni így kell: =LastIndexOf(A1; “d”)

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.