I am trying to extract substring from main string. String have not same pattern. Main string is in Column "I". Desired output should be as per column "J". I have to extract substring between "FL" and "WNG".
I have tried to write code put it is not giving proper output. Can you please assist with alternate solution to get desired output using VBA.
Sub Get_Substring()
Range("K2") = Mid(Range("I2"), InStrRev(Range("I2"), "FL") + 1, _
InStrRev(Range("I2"), "WNG") - _
InStrRev(Range("I2"), "FL") - 1)
End Sub

Debug.Print Split(Split(MyString, "REGNO")(1), "FL")(0)andDebug.Print "L" & Split(Split(Split(MyString, "REGNO")(1), "WNG")(0), "FL")(1)will give you02andL02respectively.