Option Explicit
Sub sbReimbursement()
Dim sExpenses As String
Dim iColonPos As Integer
Dim iAtPos As Integer
Dim sPrice As String
sExpenses = "58.00 km Travel Reimbursement 2001 - 3500cc Petrol: 51.62 @ Travel Reimbursement"
iColonPos = InStr(1, sExpenses, ":")
iAtPos = InStr(1, sExpenses, "@")
sPrice = Trim(Mid(sExpenses, iColonPos + 1, iAtPos - iColonPos - 1))
MsgBox sPrice
End Sub
1条答案
按热度按时间lskq00tm1#
这个代码为我工作。