View Single Post
  #3   Report Post  
Old June 4th 19, 09:07 AM posted to microsoft.public.excel.programming
GS[_6_] GS[_6_] is offline
external usenet poster
 
First recorded activity by ExcelBanter: Apr 2015
Posts: 1,042
Default Why the heck doesn't this work?

Cleaned up...

Sub ParseTextFile2a()
Dim vTmp, n&
Const sFile$ = "C:\Data.txt"
'//where the file contains "a123 A. BC #123"
'//"a123", <Tab "A. BC #123"

'Get the file text parsed by 'TAB' characters
vTmp = Split(ReadTextFile(sFile), vbTab)
For n = LBound(vTmp) To UBound(vTmp)
Debug.Print vTmp(n)
Next 'n

'Parse the 2nd element by 'SPACE' characters
vTmp = Split(vTmp(1), " ")
For n = LBound(vTmp) To UBound(vTmp)
Debug.Print vTmp(n)
Next 'n
End Sub

Returns:
a123
A. BC #123
A.
BC
#123

--
Garry

Free usenet access at http://www.eternal-september.org
Classic VB Users Regroup!
comp.lang.basic.visual.misc
microsoft.public.vb.general.discussion