Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Importing a large amount of data using Basic


Hi,

I have 16,000 files that need to be imported into an excel spreadsheet.
Ideally, each file (with about 100 different variables) would
automatically import into its own row. I'm looking for help in
creating something that will automatically go through a folder, open
each file (comma delimited), and put all the data from each file in its
own row.

Any help is Greatly Appreciated.


--
MrsButtersworth
------------------------------------------------------------------------
MrsButtersworth's Profile: http://www.excelforum.com/member.php...o&userid=23724
View this thread: http://www.excelforum.com/showthread...hreadid=373997

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1,588
Default Importing a large amount of data using Basic

You can use dir() or the filesystem object to loop through all files
in a directory.

eg from:
http://groups-beta.google.com/group/...8c04cb38a6cbb2


Sub AllFolderFiles()
Dim wb As Workbook
Dim TheFile As String
Dim MyPath As String
MyPath = "C:\Temp"
ChDir MyPath
TheFile = Dir("*.xls") 'adjust extension
Do While TheFile < ""
Set wb = Workbooks.Open(MyPath & "\" & TheFile)
MsgBox wb.FullName
wb.Close
TheFile = Dir
Loop
End Sub


Open each file and copy the relevant information to your "master"
Excel sheet.

I would guess that 16000 files would take a long time though.

Tim.



"MrsButtersworth"
<MrsButtersworth.1plpvh_1117047663.5652@excelfor um-nospam.com wrote
in message
news:MrsButtersworth.1plpvh_1117047663.5652@excelf orum-nospam.com...

Hi,

I have 16,000 files that need to be imported into an excel
spreadsheet.
Ideally, each file (with about 100 different variables) would
automatically import into its own row. I'm looking for help in
creating something that will automatically go through a folder, open
each file (comma delimited), and put all the data from each file in
its
own row.

Any help is Greatly Appreciated.


--
MrsButtersworth
------------------------------------------------------------------------
MrsButtersworth's Profile:
http://www.excelforum.com/member.php...o&userid=23724
View this thread:
http://www.excelforum.com/showthread...hreadid=373997



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
Reformating large amount of data Jason Excel Discussion (Misc queries) 2 April 10th 08 10:41 PM
Grouping large amount of data by day-of-week Dan Excel Discussion (Misc queries) 3 January 16th 08 04:34 PM
Changing large amount of Data glnbnz Excel Discussion (Misc queries) 5 January 12th 07 07:44 PM
Large amount of data for plotting dharshanie Charts and Charting in Excel 7 May 24th 06 05:08 PM
CopyFromRecordset with large amount of data rweide Excel Programming 9 October 18th 04 03:25 PM


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

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

About Us

"It's about Microsoft Excel"