This answer is provided by Tushar Mehta
 

ID: 10

Category: Excel VBA

Question: Is it possible to have the InstrRev and StrReverse functions in XL97?

Answer: You could write your own.

#If VBA6 = 0 Then
Function StrReverse(s As String)
    Dim i As Long
    For i = Len(s) To 1 Step -1
        StrReverse = StrReverse & Mid(s, i, 1)
        Next i
    End Function
Function InstrRev(StringCheck As String, StringMatch As String, _
    Optional Start As Long = 1, Optional Compare As Long = 0)
    InstrRev = Len(StringCheck) _
        - (InStr(Start, StrReverse(StringCheck), StrReverse(StringMatch), Compare) _
        + Len(StringMatch) - 1) + 1
    End Function
    #End If

ExtendedLink:  


Website material copyright 2003-2006 TM Faculty Associates