Home |
Search |
Today's Posts |
#5
![]()
Posted to microsoft.public.excel.worksheet.functions
|
|||
|
|||
![]()
Thank you very much.
-- jake "Joel" wrote: I'm in the mood today to write my own functions. try this Function FindLast(ShortString, LongString) As Integer Shortlength = Len(ShortString) LongLength = Len(LongString) FindLast = 0 If (Shortlength <= LongLength) Then StringPosition = LongLength - Shortlength + 1 For i = StringPosition To 1 Step -1 If (StrComp(ShortString, Left(Mid(LongString, i, Shortlength), Shortlength)) = 0) Then FindLast = i Exit For End If Next i End If End Function "Jakobshavn Isbrae" wrote: How can I find the last occurrence of a substring with a larger string? -- jake |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
Substring | Excel Discussion (Misc queries) | |||
Substring | Excel Discussion (Misc queries) | |||
Substring in excel? How about regular expressions? | Excel Discussion (Misc queries) | |||
Sumproduct based on substring? | Excel Worksheet Functions | |||
Vlookup using a substring for evaluation? | Excel Worksheet Functions |