VBA 里面函数抓取字符串
以下字符串:31X9.50R16 106X109.50R16 165R13 185/60R16 P135/45R15 最前面两个字符串当中9.50 109.50的整数位为不固定位数,怎样用VBA函数形式抓取话红线部分,所有字符串栏位为"{{A65A}}",大神请帮忙解答下,谢谢
Dim P1 As Integer AA = Array("31X9.50R16", "106X109.50R16", "165R13", "185/60R16", "P135/45R15") Dim BB() As String, XX1 As Integer, XX2 As Integer, TT As Integer P1 = UBound(AA) ReDim BB(P1) For I = 0 To P1 If InStr(1, AA(I), "X") > 0 And InStr(1, AA(I), "R") > 0 Then XX1 = InStr(1, AA(I), "X") XX2 = InStr(1, AA(I), "R") TT = Len(AA(I)) BB(I) = Mid(AA(I), XX1 + 1, XX2 - XX1 - 1) ElseIf InStr(1, AA(I), "R") > 0 Then XX1 = InStr(1, AA(I), "R") BB(I) = Left(AA(I), XX1 - 1) End If If InStr(1, AA(I), "/") > 0 Then XX1 = InStr(1, AA(I), "/") BB(I) = Left(AA(I), XX1 - 1) End If Text1.Text = Text1.Text & BB(I) & Space(6) Next I