I'm trying to parse a text document using VBA and return the path given in the text file. For example, the text file would look like:
*Blah blah instructions
*Blah blah instructions on line 2
G:\Folder...data.xls
D:\AnotherFolder...moredata.xls
I want the VBA to load 1 line at a time, and if it starts with a *
then move to the next line (similar to that line being commented). For the lines with a file path, I want to write that path to cell, say A2
for the first path, B2
for the next, etc.
The main things I was hoping to have answered were:
- What is the best/simple way to read through a text file using VBA?
- How can I do that line by line?
Question&Answers:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…