View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.programming
Wild Bill[_3_] Wild Bill[_3_] is offline
external usenet poster
 
Posts: 4
Default import text w/macro

Maybe import it line by line, cut the information you need, and paste
it. Here's an example:

strSourceFile = "C:\Sample.txt"
lngInputFile = FreeFile
Open strSourceFile For Input As lngInputFile
iRowCount = 1
While Not EOF(lngInputFile)
Line Input #lngInputFile, strInText
strOutText = Left(strInText, 40) & Mid(strInText,100,40) &
Right(strInText,50)
Cells(iRowCount,"A")=strOutText
iRowCount = iRowCount + 1
Wend
Close lngInputFile

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!