K
ker_01
In Excel, I recorded a macro while importing a text file (because that's the
easiest way I've found to capture the fixed-width values for my fields). It
imported just fine.
Now I'm using VBA to import that same text file a line at a time and parse
each line for data values. I was having trouble (after the first line, the
code would quit). I used a msgbox to display that first line prior to
parsing- and it showed me the whole file! (or as much as could fit in a
msgbox, anyway).
So somehow, on importing the text file via the menu (file/open), Excel knew
that there were multiple lines and put the data in multiple rows. However,
when I use:
Do While Not EOF(1)
Line Input #1, LineofText
MsgBox LineofText
Loop
It opens the entire file as one line.
Clearly I'm missing something here, but I'm not sure what. Any suggestions?
Thank you,
Keith
easiest way I've found to capture the fixed-width values for my fields). It
imported just fine.
Now I'm using VBA to import that same text file a line at a time and parse
each line for data values. I was having trouble (after the first line, the
code would quit). I used a msgbox to display that first line prior to
parsing- and it showed me the whole file! (or as much as could fit in a
msgbox, anyway).
So somehow, on importing the text file via the menu (file/open), Excel knew
that there were multiple lines and put the data in multiple rows. However,
when I use:
Do While Not EOF(1)
Line Input #1, LineofText
MsgBox LineofText
Loop
It opens the entire file as one line.
Clearly I'm missing something here, but I'm not sure what. Any suggestions?
Thank you,
Keith