Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Import data from multiple files

Hi,

I currently have a data query that imports data from multiple "TEXT" files
in a folder one file at a time when I select them.

I have to individually select the file, the query is run and imports the data.

Is it possible to have Excel open a folder, select all the files
(individually or all together) and import the data. the files are CSV.

I can then manipulate the data once it's in but the time consuming bit is
getting it in. I would use MS Access but don't have it....YET!

Thanks in advance.....

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 8,520
Default Import data from multiple files

Daear Dean

The below code should do.......

Dim strFolder, strFile

strFolder = "C:\"
strFile = Dir(strFolder & "*.csv", vbNormal)
Do While strFile < ""
'Write your import code here
strFile = Dir
Loop


If this post helps click Yes
---------------
Jacob Skaria

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 93
Default Import data from multiple files

Jacob,

Looks brill. Thanks
Dean

"Jacob Skaria" wrote:

Daear Dean

The below code should do.......

Dim strFolder, strFile

strFolder = "C:\"
strFile = Dir(strFolder & "*.csv", vbNormal)
Do While strFile < ""
'Write your import code here
strFile = Dir
Loop


If this post helps click Yes
---------------
Jacob Skaria

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 11,123
Default Import data from multiple files

Hi Dean

See also
http://www.rondebruin.nl/csv.htm

Or
http://www.rondebruin.nl/txtcsv.htm


--

Regards Ron de Bruin
http://www.rondebruin.nl/tips.htm




"Dean" wrote in message ...
Hi,

I currently have a data query that imports data from multiple "TEXT" files
in a folder one file at a time when I select them.

I have to individually select the file, the query is run and imports the data.

Is it possible to have Excel open a folder, select all the files
(individually or all together) and import the data. the files are CSV.

I can then manipulate the data once it's in but the time consuming bit is
getting it in. I would use MS Access but don't have it....YET!

Thanks in advance.....

Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Import data from multiple excel files in one folder WingZero Excel Programming 7 December 13th 07 07:30 PM
Import data from multiple txt files into one xls file Steve[_4_] Excel Programming 3 October 20th 07 12:08 PM
Import data from multiple excel files Arlan Excel Programming 1 December 22nd 05 08:19 PM
Excel VBA - Import Data for manipulation from multiple text files ZX210 Excel Programming 2 January 13th 04 02:38 PM
Import multiple files macro can't find files Steven Rosenberg Excel Programming 1 August 7th 03 01:47 AM


All times are GMT +1. The time now is 04:56 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"