ExcelBanter

ExcelBanter (https://www.excelbanter.com/)
-   Excel Programming (https://www.excelbanter.com/excel-programming/)
-   -   Importing text files into a "cached" worksheet? (https://www.excelbanter.com/excel-programming/404281-importing-text-files-into-cached-worksheet.html)

Zilla[_4_]

Importing text files into a "cached" worksheet?
 
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.

ShaneDevenshire

Importing text files into a "cached" worksheet?
 
Hi,

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

--
Cheers,
Shane Devenshire


"Zilla" wrote:

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.


Dave Peterson

Importing text files into a "cached" worksheet?
 
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

Zilla wrote:

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.


--

Dave Peterson

Zilla[_4_]

Importing text files into a "cached" worksheet?
 
On Jan 15, 2:44 pm, Dave Peterson wrote:
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

Zilla wrote:

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.


--

Dave Peterson


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?

Dave Peterson

Importing text files into a "cached" worksheet?
 
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



Zilla wrote:

On Jan 15, 2:44 pm, Dave Peterson wrote:
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

Zilla wrote:

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.


--

Dave Peterson


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?


--

Dave Peterson


All times are GMT +1. The time now is 01:32 PM.

Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com