PDA

View Full Version : Simple question



ripkin900
12-16-2011, 07:52 AM
Hi guys,
I have a simple VBA macro code question...
I work with various reports-they are all in either excel or text format..

I need a some simple code to getfile - open it, save the excel of text file as a variable - then paste into a seperate worksheet...

One report has like 6 different spreadsheets/textfiles I copy and paste.....
I have a macro to import and manipulate the text files.....
If I can just get them imported all at once, I can do the rest...

I would like a message box...
It would like say...get file 1, get file 2, get file 3....etc...
then press a button, macro button, to combine(copy/paste) all the files into the one spreadsheet....

One other thing...
We use excel 2003 and as yuo all know it is limited to ~65000 rows...
Is there any way to break up a text file into smaller pieces?
One text file is 5000 pages long, once i import it, sort it, etc, it has considerable less rows....so if i could import it in chuncks, sort it, then put it back together then re-import it as an excell file it would come in under the 65000 rows...

thanks so so much in advance...

Jeff

Bob Phillips
12-16-2011, 09:51 AM
Take a look at GetopenFilename in VBA help.

shrivallabha
12-17-2011, 08:44 AM
For bringing in large files (with rows more than 65536), someone has already done hardwork with commented neat code.

Take a look:
http://www.cpearson.com/excel/ImportBigFiles.aspx