Parse substrings
Hi Robert,
Am Thu, 10 Oct 2019 02:43:53 -0700 (PDT) schrieb RG III:
My input string is a set of numbers that represent prices.
Each price is separated by one or more spaces AND/OR tabs.
For example:
s = " 1200 300 25 2 4 10000 "
There might also be tabs separating numbers, such as:
s = " 1200[tab]300 25 2 4[tab][tab]1000 "
you also can try:
Sub Test()
Dim s As String
Dim varMatches As Variant
s = " 1200 " & vbTab & " 300 25 2 4" & vbTab & vbTab & "1000 "
s = Replace(s, vbTab, " ")
s = Application.Trim(s)
varMatches = Split(s, " ")
End Sub
Regards
Claus B.
--
Windows10
Office 2016
|