How to match entire string using RegExp VBA after a keyword

时间:2017-08-04 13:12:01

标签: regex vba excel-vba access-vba outlook-vba

could anybody give me a hint regarding this issue? I want to extract everything behind 'Description : 96 pcs of '.

Description : 96 pcs of  99999-9XXXX*99999 XXX XX XXXX, XX/XXX XXX 9

1 个答案:

答案 0 :(得分:0)

你不需要Regex:

Sub qwerty()
    Dim s1 As String, s2 As String, s3 As String
    s1 = "Description : 96 pcs of  99999-9XXXX*99999 XXX XX XXXX, XX/XXX XXX 9"
    s2 = "Description : 96 pcs of"
    s3 = Mid(s1, InStr(1, s1, s2) + Len(s2))
    MsgBox s3
End Sub

enter image description here