1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27
| Sub Ext_Straddlevs()
Dim code As String
Dim maturity As String
Dim tenor As String
Dim instrum As String
Dim Last As String
Dim pos1 As Integer
Dim pos2 As Integer
Dim pos3 As Integer
code = "100m10y @123 vs 2040"
pos1 = InStr(code, "m") Or InStr(code, "y")
pos2 = InStr(pos1 + 1, code, "y")
pos3 = InStr(code, "@")
pos4 = InStr(pos3 + 1, code, "vs")
maturity = Trim(Left(code, pos1))
tenor = Trim(Mid(code, pos1 + 1, pos2 - pos1))
instrum = "Straddle"
Last = Trim(Mid(code, pos3 + 1, pos4 - pos3 - 1))
straddle = Trim(Mid(code, pos4 + 2))
MsgBox "Maturite :" & maturity & vbLf & vbLf & " Tenor :" & tenor & vbLf & vbLf & "Instrument :" & instrum & vbLf & vbLf & "Last :" & Last & vbLf & vbLf & "Strad :" & straddle
End Sub |
Partager