Importing text files into a "cached" worksheet?

Z

Zilla

I have read lots of good info in the NG on how to import CSV files
into current workbook, worksheet etc. With these methods, if I import
5 files for example, I'll end up with 5+1=6 sheets, the 5 imported
files plus the original sheet.

However, I want to import the files, do something with the data in all
of them, and put the final data into the ONE sheet, so my workbook
ends up with this ONE sheet. Besides creating the worksheets and then
deleting them later, can I just "cache" them? Thanks.
 
S

ShaneDevenshire

Hi,

If I understand you question, no! You can't import the text files directly
into a cache rather than into a sheet.
 
Z

Zilla

You could combine the .csv files into one and then import just one file.http://www.rondebruin.nl/csv.htm
(from Ron de Bruin's site)

But you could just open the .csv (as a new workbook), copy the data and paste to
your worksheet, then close the .csv file. Repeat another four times.

Ron has some other code that uses data|import external data:http://www.rondebruin.nl/txtcsv.htm

Ok thanks! I implemented a routine that just deletes the worksheet,
but how can I disable the prompt that asks if I want to delete it or
not?
 
D

Dave Peterson

Do you really mean delete a worksheet?

application.displayalerts = false
'your code to delete the worksheet
application.displayalerts = true

Or did you mean that you want to close the file without being prompted:

someworkbookvariablehere.close savechanges:=false
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top