自己写了一段代码,能解决,请指教
Public Function 订单ID(StrB As Variant) As Variant
Dim j As Integer
Dim I As Integer
Dim N As Integer
Dim StrTemp
Dim StrID
If Len(StrB) > 0 Then
N = Len(StrB)
For I = 1 To N
If IsNumeric(Mid(StrB, I, 1)) Then
j = I
Exit For
End If
Next
For I = j To N
If IsNumeric(Mid(StrB, I, 1)) Then
StrTemp = StrTemp & Mid(StrB, I, 1)
Else
Exit For
End If
Next
订单ID = StrTemp
End If