VBA Code to import several fix width txt files and remove headers and footers
I am trying to build a newer database 2010, based on an older one,2000, that has been locked tight and I cannot see the modules to kinda get a reference of where to start. I am trying to find a VBA code that will allow me to import a several text files to one table. The text files are all in the same format but I cannot remove the page headers and footers to get the table to look right.
Header
Header
Header
Header
Header
Header
Header
Blank Space
Name Emp# GRD DDDD DDDD WC Code Narrative Intvl Status Date Date Evt ID
Blank Space
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date 11111
.................................................. ...2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date
.................................................. ...2345 ABCDE ABC6 Qual Date Date 11111
Footer
Footer
Then this repeats itself for several pages.
Also, it appears in the previous table once imported into the old AD like this:
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date 11111
J.Smith 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date
J.Adam 1234 01 ABCD ABCD HGJV 2345 ABCDE ABC6 Qual Date Date 11111
If I could import the text files and end up with a table like this, it would be all i need as i could run all the queries i need from this. Any help anyone can offer I would really greaty appreciate it.
Thanks
Last edited by NEWGUY23; August 1st, 2013 at 09:52 PM..
|