Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Sub ImportData()
- Filename = InputBox("Enter the file path")
- 'Filename = the full path to Your txt file eg."C:\MyDocuments\Mytxt.txt"
- Open Filename For Input As #1
- Do While (Not EOF(1))
- ' In this case the file is delimited by , and contains several lines
- ' Read the file one line at the time
- Input #1, Streng
- 'Input streng into and array
- StrArray = Split(Streng, ",")
- Call WriteToExcel(StrArray)
- Loop
- Close #1
- End Sub
- Sub WriteToExcel(StrArray)
- For J = LBound(StrArray) To UBound(StrArray)
- 'Do what you want to do with the data
- Next J
- End Sub
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement